home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / hh_str13.zip / MANUAL.DOC < prev    next >
Text File  |  1993-03-13  |  801KB  |  23,421 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.           █   █ █    █  ███    █████ ████  █████ █   █  ███
  21.           █   █ █    █ █   █   █   █   █   █   █   █ █   █
  22.           █   █ █    █ █      █   █   █   █   ██  █ █
  23.           █████ █████  ███      █   ████    █   █ █ █ █  ██
  24.           █   █ █    █     █   █   █ █     █   █  ██ █   █
  25.           █   █ █    █ █   █   █   █  █    █   █   █ █   █
  26.           █   █ █    █  ███      █   █   █ █████ █   █  ███
  27.  
  28.  
  29.  
  30.         hhstring --- the Hobbit House String Library
  31.  
  32.                  version 1.3
  33.                  ===========
  34.  
  35.                     from
  36.                      
  37.                  Hobbit House software
  38.  
  39.             2039 Civic Center Dr.  Suite 555
  40.  
  41.                 N. Las Vegas, NV, 89030
  42.  
  43.                   March, 1993
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.                          The Hobbit House String Library
  58.  
  59.  
  60.  
  61.                  TABLE OF CONTENTS
  62.                  =================
  63.  
  64.  
  65.      section                                page #
  66.      -------------------------------------------------------------  ------
  67.  
  68.      1.0 introduction ............................................     1
  69.  
  70.      1.1 The Distribution Packagess ..........................     1
  71.  
  72.          1.1.1 The Shareware Package .........................     1
  73.          1.1.2 The Commercial Package ........................     2
  74.  
  75.      1.2 The Electronic Manual, or "Buddy, Can You
  76.                 Spare 500 Sheets of Paper?" ..........     2
  77.      1.3 Library Usage or "how I Learned to Delegate
  78.                Trivia and Get on With the
  79.                More Important Things in Life" ........     2
  80.      1.4 New Strings .........................................     3
  81.      1.5 Too Many Functions ? ................................     3
  82.      1.6 Printing the .C files ...............................     3
  83.      1.7 Error Conditions ....................................     4
  84.      1.8 What's Next ? .......................................     4
  85.  
  86.      2.0 Documentation ...........................................     5
  87.  
  88.      2.1 Metalanguage ........................................     5
  89.      2.2 Function Documentation ..............................     5
  90.      2.3 Naming Conventions ..................................     8
  91.  
  92.          2.3.1 "Standard" Abbreviations ......................     8
  93.          2.3.2 "text" v.s. "word" ............................     9
  94.          2.3.3 "wordnext" v.s. "nextword" ....................    10
  95.          2.3.4 Left v.s. Right for the
  96.             Directionally Handicapped ................    10
  97.          2.3.5 Some Pointer Examples .........................    11
  98.  
  99.      2.4 The KWIC Index ......................................    12
  100.      2.5 The Black Model-T Ford ..............................    12
  101.      2.6 A Word About Macros .................................    13
  102.      2.7 NULL vs EOS .........................................    13
  103.  
  104.      3.0 Borland v.s. Microsoft ..................................    14
  105.  
  106.      4.0 Utilities ...............................................    15
  107.  
  108.      4.1 hhstring Utilities ..................................    15
  109.  
  110.          4.1.1 funcfind ......................................    16
  111.          4.1.2 make_man ......................................    16
  112.          4.1.3 test_str and testdate .........................    16
  113.          4.1.4 cprint ........................................    17
  114.  
  115.                          The Hobbit House String Library
  116.  
  117.  
  118.      4.2 The Creation and Maintenance Uutilities .............    17
  119.  
  120.          4.2.1 sorc_chk ......................................    17
  121.          4.2.2 window ........................................    18
  122.          4.2.3 index .........................................    18
  123.          4.2.4 compress/expand ...............................    18
  124.          4.2.5 drwin .........................................    18
  125.          4.2.6 protoflt ......................................    19
  126.  
  127.      5.0 Royalties and Distribution Rights .......................    19
  128.  
  129.      6.0 The Hobbit House Group ..................................    19
  130.  
  131.      7.0 Ordering Information ....................................    20
  132.  
  133.      8.0 Technical Support .......................................    20
  134.  
  135.      9.0 Function Listings .......................................    21
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.                          The Hobbit House String Library
  175.  
  176.  
  177.      1.0 Introduction
  178.      ================
  179.  
  180.      The hhstring library is an extension of work performed on the user
  181.      interface portion of a number of DOS-based programs written under
  182.      Borland and/or Microsoft C/C++, starting in 1986 and actively continuing
  183.      through the present. The library has been added to, fully tested, and
  184.      extensively documented. Several utilities were written along the way to
  185.      make the library easy to maintain and easy to use.
  186.  
  187.      The documentation for hhstring comes in 4 parts:
  188.  
  189.      o this manual
  190.  
  191.      o the source code files (which may be included in this manual in
  192.        addition to being provided separately)
  193.  
  194.      o the KWIC index
  195.  
  196.      o the online function finder
  197.  
  198.      Only the KWIC index is specifically designed to be printed out.  The
  199.      documentation is discussed in section 2.0.
  200.  
  201.      Although most of the work done during the creation of the library was
  202.      done under the Borland compilers (TC 1.5 through BC 3.1), all of the
  203.      functions, plus the test program, have been compiled under the current
  204.      Microsoft compiler as well (MSC 7.0). Some comments regarding Borland
  205.      and Microsoft are in section 3.0.
  206.  
  207.      Section 4.0 discusses the various utilities which surround the library.
  208.      There are two "flavors" of utilities, the hhstring utilities (that is,
  209.      ones which are essentially a part of the hhstring library), and the
  210.      creation/maintainance utilities (these are not necessary for the use of
  211.      the library and are a separate package).
  212.  
  213.  
  214.      1.1 The Distribution Packages
  215.      =============================
  216.  
  217.      The hhstring package comes in two flavors; the demo version and the
  218.      commercial version. These are described in the following sections.
  219.  
  220.  
  221.      1.1.1 The Demo Package
  222.      ======================
  223.  
  224.      The demo version of hhstring is a fully functional package, but only
  225.      includes the tiny model library. It contains the manual (without source
  226.      code), the KWIC index, and the on-line function finder. The demo version
  227.      may be copied and distributed freely, with only the restriction, that it
  228.      be distributed exactly AS IS; that is, all files must be included. If
  229.      you ZIP it (or LZH it, or whatever), the .ZIP file should contain only
  230.      the three files (readme.1st, squashed.dat, and expand.exe) which are on
  231.  
  232.      page   1            The Hobbit House String Library
  233.  
  234.      the distribution disk for the demo version. 
  235.  
  236.  
  237.      1.1.2 The Commercial Package
  238.      ============================
  239.  
  240.      The commercial package contains all 6 memory models for both the Borland
  241.      (BC 3.1) and the Microsoft (MSC 7.0) compilers, plus full source code for
  242.      all of the functions in the library. The manual creation process has the
  243.      option to include the source code listings directly in the manual if you
  244.      wish.
  245.  
  246.      The commercial version of hhstring is copyrighted and may NOT be copied
  247.      or distributed in any way other than the creation of a backup copy for
  248.      use by the owner.
  249.  
  250.  
  251.      1.2 The Electronic Manual, or "Buddy,
  252.      Can You Spare 500 Sheets of Paper?"
  253.      =======================================
  254.  
  255.      The manual is over 500 pages long (for the commercial version with full
  256.      source code included). It just isn't possible to produce and distribute
  257.      a printed manual this size and still keep the product priced under $40.
  258.      For those of you who want, or insist on (as we do), a printed copy for
  259.      your reference shelf, you'll just have to bite the bullet and print it
  260.      out.
  261.  
  262.      We regret that this is the case, but hope you will understand.
  263.  
  264.  
  265.      1.3 Library Usage or "How We Learned to Delegate Trivia
  266.      and Get on With the More Important Things in Life"
  267.      ======================================================
  268.  
  269.      As programmers, we have mixed feelings about libraries. The bad news is
  270.      that libraries rob us of the joy of doing it ourselves but the good news
  271.      is that libraries let us delegate the "small stuff" and get on with more
  272.      creative things. We find that most of our fellow programmers with whom
  273.      we discuss this issue feel pretty much the same.
  274.  
  275.      Over the years, we've moved away from the former point of view and
  276.      embraced the latter. As we move further into the 90's and see more and
  277.      more tools on the order of Visual BASIC, Turbo Vision and so forth,
  278.      the programmers who don't pretty quickly get used to delegating the
  279.      "small stuff" (which is getting larger and larger as the years go by)
  280.      will get left behind.
  281.  
  282.      It's important to know HOW to do the small stuff, but it is also
  283.      important to not spend too much of your time actually DOING it! The
  284.      intent of hhstring is to allow you to delegate a major portion of your
  285.      non-graphical user interface needs to a library which is well organized,
  286.      well documented, and fully supported.
  287.  
  288.  
  289.  
  290.  
  291.                          The Hobbit House String Library               page   2
  292.  
  293.      1.4 New Strings
  294.      ===============
  295.  
  296.      In some C libraries, the functions create new strings. This has the
  297.      advantage that the calling function needn't worry about the creation of
  298.      the new string, but it has the disadvantages that (1) the new string
  299.      size has to be limited to something fairly small (256 bytes is generally
  300.      the largest you will find) because you would otherwise clutter up memory
  301.      with an awful lot of string space you don't really need and (2) every
  302.      "new-string" function called creates yet another new string which may not
  303.      be needed at all (since the calling function might well be able to make
  304.      use of only a small number of string allocations to handle ALL of the
  305.      "new-string" function calls).
  306.  
  307.      Because of the disadvantages of having the function create the new
  308.      string, we decided to have the functions in our library use new strings
  309.      allocated by and pointed to by the calling functions. This way, the
  310.      size of the created string is not dictated by our library, but rather
  311.      is under the control of your calling program.
  312.  
  313.      Additionally, we have provided, for many of the functions, alternate
  314.      versions which allow the calling program to specify that the operation
  315.      takes place on one string with the result going to a different
  316.      string, leaving the original string unchanged. These are the "new"
  317.      functions (i.e. those functions whose name ends in "new").
  318.  
  319.  
  320.      1.5 Too Many Functions ?
  321.      ========================
  322.  
  323.      We have had a number of comments about the uselessness of various of the
  324.      functions. In most cases we have had other users who praised the same
  325.      functions. Just as one example, one fellow was irate that we would bother
  326.      to include functions which take as input ASCII-numeric strings containing
  327.      commas. His argument was that commas are useful for output, since that
  328.      makes things more readable for humans, but nobody inputs that way.
  329.      Another customer was specifically delighted with the same functions
  330.      because of their direct application to his conversion of scanned text to
  331.      numeric form.
  332.  
  333.      The point is this: if you think some of the functions are useless you're
  334.      probably right. For now. Hang on to them, though; you never know when
  335.      they will come in handy. For now just consider them "extras" and make
  336.      good use of the functions you CAN use. We think you'll be surprized how
  337.      many of them you end up using once you get used to including HHSTRING in
  338.      your programming.
  339.  
  340.  
  341.      1.6 Printing the .C files
  342.      =========================
  343.  
  344.      The .C files are spaced for printing by the CPRINT utility. The .EXE
  345.      file of this utility is included with the demo package. You are certainly
  346.      free to print the source code in any way you wish, we just want you to
  347.      know that if you use something other than CPRINT, the page breaks may
  348.  
  349.      page   3            The Hobbit House String Library
  350.  
  351.      come at inappropriate places in the text/source. Another advantage to
  352.      using CPRINT is that it will put the file name on the top of each page.
  353.  
  354.      The MAKE_MAN utility uses a dedicated version of CPRINT.
  355.  
  356.  
  357.      1.7 Error Conditions
  358.      ====================
  359.  
  360.      In hhstring, error conditions and anomalous conditions have been tested
  361.      for and accounted for extensively in the code.  Some execution time and
  362.      run-time memory space are used by all of the checking we do for erroneous
  363.      and/or anomalous conditions. Nothing's free.
  364.  
  365.      The documentation specifically points out any conditions under which the
  366.      functions might create anomalous values if used carelessly. This is
  367.      particulary true of the "prev" functions. Nothing is every really idiot
  368.      proof, 'cause us idiots are so damned clever, but we've spent a lot of
  369.      time making hhstring test for boundary conditions and resolve anomalous
  370.      conditions.
  371.  
  372.  
  373.      1.8 What's Next ?
  374.      =================
  375.  
  376.      There are a number of functions which we have added to the list of those
  377.      that should appear in hhstring, but which we were unable to include in
  378.      this release. We would appreciate any suggestions you have as to
  379.      functions you would like to see added, or any improvements you would
  380.      suggest for hhstring.
  381.  
  382.      Some of the specific functions being considered for the next release are:
  383.  
  384.       o count the number of:
  385.           - characters {not} in a group
  386.           - characters {not} in a range
  387.           - upper/lower case letters
  388.           - digits (octal/decimal/hexidecimal)
  389.           - punctuation characters
  390.           - whitespace characters
  391.           - non-whitespace characters
  392.           - blanks, tabs, etc and non-blanks, tabs, etc.
  393.           - words
  394.           - text words
  395.       o sum-to-zero checksum functions
  396.       o checksum functions which allow binary 0 as a valid data element
  397.       o delete characters not in a group, not in a range
  398.       o time functions similar to date1 through date7
  399.       o convert multiple blanks to one blank
  400.       o convert multiple blanks and/or tabs to one blank
  401.       o tabtoblanknew/blanktotabnew
  402.       o tabtoblankq{new}  (these functions handle
  403.       o blanktotabq{new}   quoted strings properly)
  404.       o strisprefix, strissuffix (is given str a prefix/suffix ?)
  405.       o Htoc to give 'F' where htoc gives 'f'
  406.       o "safe" versons of strwordprev and strtextprev
  407.  
  408.                          The Hobbit House String Library               page   4
  409.  
  410.       o str<word | text>n (get the nth word|text)
  411.  
  412.  
  413.      2.0 Documentation
  414.      =================
  415.  
  416.      There are two things that make hhstring stand out from the average
  417.      function library. The first is the fact that it addresses only one small
  418.      area (strings) but has extreme depth of coverage of that one area. The
  419.      second thing is the documentation. This includes a KWIC index, an online
  420.      function finder, a full description of every function, and comments on
  421.      every line of source code in every function in the library.
  422.  
  423.      The following sections (2.1 through 2.6) discuss various aspects of the
  424.      hhstring documentation.
  425.  
  426.  
  427.      2.1 Metalanguage
  428.      ================
  429.  
  430.      There are occasional uses in the documentation of fairly common and very
  431.      straightforward "metalanguage" symbols. These are:
  432.  
  433.         <required>   the "<>" designates required information
  434.  
  435.         |         the "|" designates "or"
  436.  
  437.         {optional}   the "{}" designates optional information
  438.  
  439.      An example:
  440.  
  441.         ptr<first | last | next | prev > {not} hex
  442.  
  443.      implies a set of names, all of which start with "ptr", each of which then
  444.      contains exactly one of the substrings "first" or "last" or "next" or
  445.      "prev", and each of which may or may not then contain the substring "not"
  446.      and all of which end in the substring "hex". This set consists of the
  447.      following 8 names:
  448.  
  449.         ptrfirsthex       ptrfirstnothex
  450.         ptrlasthex       ptrlastnothex
  451.         ptrnexthex       ptrnextnothex
  452.         ptrprevhex       ptrprevnothex
  453.  
  454.  
  455.      2.2 Function Documentation
  456.      ==========================
  457.  
  458.      Every function in the hhstring library is documented in accordance with
  459.      the following "function header". It is shown below in "empty" form, and
  460.      there follows a complete description of all the fields and what typically
  461.      goes into them. The format of this function header is used by the utility
  462.      SORC_CHK.EXE (see section 4.4.1) to help verify that all functions are
  463.      fully documented.
  464.  
  465.  
  466.  
  467.      page   5            The Hobbit House String Library
  468.  
  469.      /*               ┌───────────────────────┐       function_name
  470.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  471.                   └───────────────────────┘
  472.                    copyright(c) 1992, 1993
  473.  
  474.      function:         function_name (FUNCTION NAME)
  475.  
  476.      purpose:
  477.  
  478.      syntax:         #include "hhstring.h"
  479.  
  480.      description:
  481.  
  482.      returns:
  483.  
  484.      comments:
  485.  
  486.      keywords:
  487.  
  488.      key sentence:
  489.  
  490.      see also:
  491.  
  492.      usage example:  compiled/executed/verified on <date>
  493.  
  494.                   ┌───────────────────────┐
  495.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  496.                   └───────────────────────┘              */
  497.  
  498.  
  499.      First a general note: the descriptions, comments, etc. in this function
  500.      header are frequently done as incomplete sentences and without proper
  501.      capitalization and punctuation. The goal here is clarity of expression,
  502.      not linguistic purity. If it offends you that we neglect to capitalize
  503.      the first letter of each sentence, for example, we apologize, but not an
  504.      awful lot. (we are not talking here about the descriptions below, but the
  505.      ones being described by the ones below)
  506.  
  507.  
  508.      function:         The function name is shown along with a highlighted (by
  509.      ---------         capital letters) version of the mnemonic that the
  510.              function name is derived from. Note that there is a copy
  511.              of the function name at the upper right corner of the
  512.              header, another in the syntax line, several in the code
  513.              snipped under usage example, one in the function
  514.              declaration itself, and finally another in the last line
  515.              of the comment. There is a reason for each of these
  516.              occurances of the name, but it does leave a lot of room
  517.              for mistakes when a name changes, so SORC_CHK.EXE (see
  518.              section 4.2.1) makes sure that they are all the same.
  519.  
  520.      KWIC:         An informal statement of what the function is good for,
  521.      -----         done with keywords preceded by the percent character (%),
  522.              so that this sentence can be used with the KWIC index
  523.              (see section 2.4). A more formal, and rigorous statement
  524.              of what the function does appears in "description:"
  525.  
  526.                          The Hobbit House String Library               page   6
  527.  
  528.              below.
  529.  
  530.      syntax:         Shows the formal syntax of the function, including any
  531.      -------         headers files which need to be included to make the
  532.              function work properly, plus the formal parameters of
  533.              the function call.
  534.  
  535.      description:    Gives a technical description of the function, using the
  536.      ------------    formal parameters shown in the syntax description above.
  537.  
  538.      returns:         Describes the value, if any, returned by the 
  539.      --------         function
  540.  
  541.      comments:         Notes about boundary conditions, peculiarities of any
  542.      ---------         sort, similarities/difference relative to other
  543.              functions, etc.
  544.  
  545.      keywords:         The list of keywords used by funcfind for this 
  546.      ---------         function
  547.  
  548.      key sentence:   The descriptive sentence used by funcfind for this
  549.      -------------   function
  550.  
  551.      see also:         Refers the user to other functions in the library which
  552.      ---------         are similar in some way to this functions. Frequently,
  553.              the references use the metalanguage conventions described
  554.              in section 2.2
  555.  
  556.      usage example:  This is a "code snippet" which has been compiled and
  557.      --------------  executed. The output shown below the code snippet has
  558.              been verified as being what the code snippet acutally
  559.              produces. Whenever a source code file is modified, even
  560.              in the most trivial way, a file consisting of the
  561.              following four lines:
  562.  
  563.                    #include <stdio.h>
  564.  
  565.                    void main(void)
  566.  
  567.                    {
  568.  
  569.                    }
  570.  
  571.      is read in just in front of the function declaration and the code from
  572.      the usage example is moved down to between the curley braces. When
  573.      necessary, a .PRJ file (this is usually done under Borland) is created as
  574.      well. The resulting program is then complied and executed and the results
  575.      are compared against those shown in the usage example. This process is
  576.      re-done EVERY time any change is made in the function. The date on which
  577.      it is done is inserted on the usage example line. The date on this line
  578.      is, therefore, the "latest update" date for the source file. The file
  579.      itself may carry a different DOS date stamp because files are "touched"
  580.      at release time, but the date on this line is the true date of the most
  581.      recent modification, no matter how trivial, of the source code.
  582.  
  583.      To assure that there are no problems with function interaction (some of
  584.  
  585.      page   7            The Hobbit House String Library
  586.  
  587.      the functions call others in the libarary), the TEST_STR.EXE utility (see
  588.      section 4.1.3) is recompiled/executed from time to time (always including
  589.      just prior to any product release).
  590.  
  591.      The primary goals of the usage examples are:
  592.  
  593.       1) make sure that the function works properly, including tests of
  594.          most or all boundary conditions (some usage examples may appear
  595.          obsessed with boundary conditions; when this happens, please
  596.          remember that it is the boundary conditions where functions
  597.          normally fail).
  598.       2) show similarities and differences between similar functions by
  599.          using similar usage examples.
  600.  
  601.      Note that the useage examples do NOT necessarily give a good example of
  602.      how the funciton might most commonly be used in a real-world situation.
  603.      
  604.  
  605.      2.3 Naming Conventions
  606.      ======================
  607.  
  608.      There are several issues involving naming conventions for hhstring. These
  609.      are addressed in the following subsections, 2.3.1 through 2.3.3.
  610.  
  611.  
  612.      2.3.1 "Standard" Abbreviations
  613.      ==============================
  614.  
  615.      Most of the "directional" functions in this library ("left", "right",
  616.      and "middle") are named according to the following set of terms.  The
  617.      two-letter combinations are used in file names so that all file names
  618.      can be kept to 8 characters or less.  Not all combinations of the
  619.      following are valid, but most are.  In particular, the "middle" functions
  620.      are much more limited than the side functions.  For example, one doesn't
  621.      shift or rotate to or from the middle.
  622.  
  623.              required  required          required     optional   optional
  624.              --------  --------          --------     --------   --------
  625.                          LF
  626.                STR       MD              see below        N         W
  627.                          RT
  628.  
  629.         meaning:
  630.                                        / SH (shift)\
  631.                                       /  RO (rotate)\
  632.                         /left \      /   JS (justify)\
  633.              <string>  <middle >    <    DL (delete)  > {number}   {new}
  634.                         \right/      \   FL (fill)   /
  635.                                       \  SZ (size)  /
  636.                                        \ TR (trim) /
  637.                                         \PD (pad) /
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.                          The Hobbit House String Library               page   8
  645.  
  646.      The pointer functions use the following abbreviations for names:
  647.  
  648.                      function name uses
  649.         file name uses:      the part in caps
  650.       ---------------------------------  ---------------------------------
  651.               /       / BK \  \       BLanK
  652.               /       / CH \  \       CHaRacter
  653.               /       / CI \  \       CHaRacter, case-Independant
  654.               /       / DG \  \       DIGit
  655.               /       / GR \  \       GRoup
  656.         / FIR  \  / {NO} <    HX  > \ {NOT} HEX
  657.         / LAST \  /       \ RN /  \       RANge
  658.       <PTR><  NEXT  ><          \ TT /   >      TEXT-TERMinator
  659.         \ PREV /  \       \ WH /  /       WHITEspace
  660.         \ THIS*/  \       \ WT /  /       WORD-TERMinator
  661.               \       SUB{I}  /       SUBstring {case-Independant}
  662.               \       TEXT    /       TEXT (see section 2.3.2)
  663.               \       WORD    /       WORD
  664.  
  665.      *NOTE: "THIS" is only used with TEXT and WORD functions
  666.  
  667.  
  668.      2.3.2 "text" v.s. "word"
  669.      ========================
  670.  
  671.      The hhstring library originally used the term "word" to mean a group of
  672.      characters not containing whitespace (blanks and/or tabs). This has
  673.      been extended to mean a group of characters not containing a "word
  674.      terminator", where a "word terminator" is defined as being any of the
  675.      characters:
  676.  
  677.             blank
  678.             horizontal tab
  679.             form-feed
  680.             carriage-return
  681.             line-feed
  682.             vertical tab
  683.             End-Of-String (binary zero)
  684.  
  685.      A "text word" is a group of characters not separated by either a word
  686.      terminator, or any of the following English language punctuation marks:
  687.  
  688.             .
  689.             ,
  690.             :
  691.             ;
  692.             !
  693.             ?
  694.  
  695.      The phrase "text terminator", as used with hhstring, means that set of
  696.      characters consisting of word terminators (see above) and the punctuation
  697.      marks just described.
  698.  
  699.  
  700.  
  701.  
  702.      page   9            The Hobbit House String Library
  703.  
  704.      2.3.3 strwordnext v.s. ptrnextword
  705.      ==================================
  706.  
  707.      There is an area of possible confusion regarding the names in hhstring
  708.      and that is the difference between the "strword..." and the "ptr...word"
  709.      functions (and the corresponding "text" functions).
  710.  
  711.      The "ptr...word" functions FIND something whereas the "strword..."
  712.      functions GET something. "strwordnext", for example, gets the next word
  713.      following a specified pointer and it puts that word into a specified
  714.      string. "ptrnextword", on the other hand, will return a pointer to the
  715.      next word following a specified pointer. The "str" and "ptr" tell the
  716.      difference (ptr => get the pointer, str => get the string), but the names
  717.      are also composed to show the relative importance of the direction
  718.      information versus the "word". That is, "wordnext" implies that the
  719.      "word" is more important than the "next", because the function is getting
  720.      a word. "nextword" implies that the next is more important because the
  721.      function is finding the position of the "next" whatever.
  722.  
  723.      If this is all too boring to remember, don't worry; that's why we have
  724.      the KWIC index and the function finder.
  725.  
  726.  
  727.      2.3.4 Left v.s. Right for the Directionally Handicapped
  728.      =======================================================
  729.  
  730.      Terminology is a wonderful thing. Years ago, people who swept floors were
  731.      called "janitors". For many years now, they have been called "building
  732.      maintenance engineers". People who carry a few extra pounds around in
  733.      front of them are no longer "fat" or "potbellied", they are "horizontally
  734.      impaired". People are now called "orifice identification impaired" where
  735.      we used to just say that they didn't know their ass from a hole in the
  736.      ground. Progress is amazing.
  737.  
  738.      Anyway, to get back to the subject at hand, there is a point of possible
  739.      confusion regarding the use of the terms "left" and "right" in this
  740.      library. We are confident that everybody can tell which side of a string
  741.      is the right side and which is the left. We expect no problems with the
  742.      functions "left" and "right" and their normal offspring such as
  743.      "strlfdel" (delete the left side of a string) and so forth.
  744.  
  745.      The potential problem comes with the "size" functions. Should "strlfsize"
  746.      mean "force a string to a fixed size using the characters from the left
  747.      side of the string" or should it mean "force the left side of a string
  748.      to do what is necessary so that the string will have a fixed size"?
  749.  
  750.      We feel confident that either choice will seem absurd to some and
  751.      reasonable to others. Thus, we offer no defense of the particular
  752.      choice made, we just want you to be aware of it.
  753.  
  754.      In hhstring, the latter choice was taken. "strlfsize" means "do whatever
  755.      it takes to the left side of a string so that the result will have a
  756.      fixed size".
  757.  
  758.      Thus,
  759.  
  760.                          The Hobbit House String Library               page  10
  761.  
  762.  
  763.             char Astring[80] = "this is string 1";
  764.             char Bstring[80] = "string 2";
  765.             printf("\n-->%s", strlfsize(Astring, 11);
  766.             printf("\n-->%s", strlfsize(Bstring, 11);
  767.  
  768.             -->is string 1
  769.             -->   string 2
  770.  
  771.      As you can see, strlfsize either truncates or pads the left side of a
  772.      string, as opposed to taking its characters from the left side of the
  773.      string.
  774.  
  775.  
  776.      2.3.5 Some Pointer Examples
  777.      ===========================
  778.  
  779.      The pointer functions all start (after the "ptr") with "first", "last",
  780.      "next", "prev", or "this". First and last seem fairly obvious. Next, prev
  781.      and this are also pretty straightforward, but we present the following
  782.      examples to avoid any confusion. The examples deal with words and use
  783.      only the standard word separator of a blank. The concepts hold equally,
  784.      however, for text words as well and for any combination of text or word
  785.      terminators (see section 2.3.2).
  786.  
  787.      ptrnextword
  788.      -----------
  789.  
  790.                 any pointer from here to here will end up here
  791.                                  ─┬──    ─┬──             ─┬──
  792.                                   │       └──┐┌────────────┘
  793.                                   │          ││
  794.                                   v          vv
  795.         first slsdjf lkjs slfdkfjldkf nextword last
  796.  
  797.  
  798.      ptrprevword
  799.      -----------
  800.  
  801.                      any pointer from here to here will end up here
  802.                                       ─┬──    ─┬──             ─┬──
  803.                                        │       └──┐             │
  804.                                       ┌┼┐        ┌┼┐            │
  805.                                ┌──────┘│└────────┘│└────────────┘
  806.                                │       │          │
  807.                                v       v          v
  808.         first llssddjf prevword slfdkfjldkf lkjeunse last
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.      page  11            The Hobbit House String Library
  820.  
  821.      ptrthisword
  822.      -----------
  823.  
  824.                      any pointer from here to here will end up here
  825.                                       ─┬──    ─┬──             ─┬──
  826.                        │      ┌┘        │
  827.                        │     ┌┼┐        │
  828.                        ├─────┘│└────────────────┘
  829.                        │      │
  830.                        │      │
  831.                        v      v
  832.         first slsdjf lkjs dnsl thisword lskdjfd last
  833.  
  834.  
  835.      2.4 The KWIC Index
  836.      ==================
  837.  
  838.      The KWIC index is one of those things that is somewhat difficult to
  839.      explain but really easy to understand. The following description is
  840.      technically accruate but will make a lot more sense if you have first
  841.      examined the KWIC index itself. See the file KWIC.DOC
  842.  
  843.      The "Key Word In Context" index is also known (to UNIX programmers) as a
  844.      "permuted index". It works like this: for each "target", a keyword
  845.      sentence is constructed with the appropriate keywords flagged in some way
  846.      (in hhstring, the percent character (%) is used). A "target" is the
  847.      "thing being searched for" and in the case of hhstring, the targets are
  848.      functions (that is, function names). The keyword sentences are then
  849.      manipulated so that the index created from them contains one occurance of
  850.      each sentence for every keyword in the sentence. Thus, if a sentence
  851.      contains 5 keywords, that sentence will appear in the KWIC index 5 times.
  852.  
  853.      The sentences are physically arranged on the page so that the keyword is
  854.      in the center of the page and is alphabetical within the total index.
  855.      Again, this may sound weird, but it will make perfect sense if you just
  856.      examine the KWIC.DOC file.
  857.  
  858.  
  859.      2.5 The Black Model-T Ford
  860.      ==========================
  861.  
  862.      Henry Ford, commenting on some people's annoyance that his Model-T Fords
  863.      were only avaliable in black, is reputed to have said "People can buy my
  864.      cars in any color they like, as long as what they like is black."
  865.  
  866.      Why do we bring that up? Well, it's like this. We noticed some years ago
  867.      that there are two ways to document software. The first way is to comment
  868.      every line of source code and the second way is to NOT comment every line
  869.      of source code. We further noticed that if the second method is chosen,
  870.      it is inevitable that decisions have to be made as to what should be
  871.      commented and what shouldn't be bothered with and the decisions usually
  872.      tend towards no documentation at all.
  873.  
  874.      On the other hand, if the first method is chosen, it means putting in
  875.      comments that are blatantly obvious to any programmer with an
  876.  
  877.                          The Hobbit House String Library               page  12
  878.  
  879.      intelligence above that of your average garden vegetable or tree stump.
  880.      We don't want our customers to think that we're insulting their
  881.      intelligence, but we also don't want to produce code which is not
  882.      adequately commented.
  883.  
  884.      So, here's our compromise: you can have our source code any way you like
  885.      it as long as what you like is comments on every line.
  886.  
  887.  
  888.      2.6 Macros
  889.      ==========
  890.  
  891.      Please observe that most of the macros in hhstring use "char *"
  892.      arguments, NOT "char" arguments. As a simple example of this, consider
  893.      the following macro from hhstring.h:
  894.  
  895.          #define ISBLANK(s)      (*(s) == ' ')
  896.  
  897.      This macro is designed to test the character pointed to by a character
  898.      pointer, NOT to test a character directly.
  899.  
  900.      Also be aware, in case you are not already, that macros can be, and
  901.      quite often are, created in a way that makes them quite treacherous
  902.      to use. The macros in hhstring.h are no exception to this rule.
  903.  
  904.      The problem is that "familiarity breeds contempt" and after long and
  905.      accustomed use of macros, we tend to forget that they ARE macros. Then we
  906.      do dumb things such as using the statement ISWHITE(ptr++) when the macro
  907.      is defined as:
  908.  
  909.         #define ISWHITE(s) ((*(s) == ' ') || (*(s) == '\t'))
  910.  
  911.      The problem is that the macro uses its argument more than once, so if we
  912.      use a macro argument which increments, it will increment more than once.
  913.      If you do this sort of thing on purpose, you can create interesting and
  914.      ammusing results, but if you do it by accident you are not likely to be
  915.      even remotely ammused.
  916.  
  917.      During the creation of hhstring, we had a particulary nasty bug due to
  918.      the fact that in Borland the "toupper" macro does NOT use it's argument
  919.      twice whereas in Microsoft it does. We used the statement:
  920.  
  921.                 delupper = toupper(instring[kk] = instring[ii++]);
  922.  
  923.      This worked fine under Borland but produced garbage under Microsoft. That
  924.      does not say that Borland did something right, or that Microsoft did
  925.      something wrong, it says that we forgot to be careful when using macros!
  926.      Our advice to you is, be careful using macros!
  927.  
  928.  
  929.      2.7 NULL v.s. EOS
  930.      =================
  931.  
  932.      Most of the "ptr" functions in hhstring will return a NULL pointer
  933.      to flag a "not found" condition. We've had enough questions about this
  934.      that we feel compelled to present a little mini-lesson here in the
  935.  
  936.      page  13            The Hobbit House String Library
  937.  
  938.      fundamentals of C programming.
  939.  
  940.      A null string is one which has a binary zero as it's first element. A
  941.      pointer to such a string is NOT a NULL pointer. A NULL pointer is a
  942.      pointer which is itself a binary zero. Thus if ptr is a NULL pointer,
  943.      *ptr may or may not be a NULL string, depending on what's at memory
  944.      location zero.
  945.  
  946.      At any rate, if ptr is a return from one of the "ptr" functions in
  947.      hhstring, the statement
  948.  
  949.         if (*ptr == EOS)
  950.  
  951.      is a terrible idea, since ptr might be a NULL pointer as opposed to a
  952.      pointer to the EOS of the string sent to the "ptr" function.
  953.  
  954.      Instead, use the statement
  955.  
  956.         if (ptr == NULL)
  957.  
  958.  
  959.      3.0 Borland v.s. Microsoft
  960.      ==========================
  961.  
  962.      In general, MSC 7.0 is more rigorous about warnings than Borland. The
  963.      variable type "size_t" has been used occasionally in the library to
  964.      typecast variables. In every instance, this was to eliminate a compiler
  965.      warning under Microsoft which did not occur under Borland. Under both
  966.      compilers, hhstring is always compiled with all warnings "ON". We approve
  967.      of the rigor of MSC 7.0's warning messages.
  968.  
  969.      Borland's IDE is considerably more user friendly than Microsoft's PWB.
  970.      The PWB appears to have been written without too much regard to how it
  971.      was going to be used, whereas the IDE is specifically designed to be
  972.      easy to use. On the other hand, the PWB is far more stable than the IDE.
  973.      We can regularly crash the IDE in any number of seemingly innocuous ways
  974.      including a simple transfer to "grep" when compiling a large program and
  975.      attempting to delete a window entry whose correspoinding file no longer
  976.      exists, whereas the PWB seems to be more reliable. This point of view
  977.      should be taken with a grain of salt since we use the IDE far more than
  978.      we use the PWB and thus we have more opportunities for problems under the
  979.      IDE than under the PWB.
  980.      
  981.      The library has been compiled and fully tested under both Borland and
  982.      Microsoft. The "code snippets" in the usage example section of every
  983.      function's documentation are usually only compiled under Borland. The
  984.      TEST_STR utility, however, has been compliled, linked, and run under
  985.      both compilers, as has the DATETEST program.
  986.  
  987.      During development there were some peculiarities of warnings and even
  988.      errors under Microsoft that didn't occur under Borland. These have been
  989.      eliminated in the final product and it will not matter whether you
  990.      compile the libary under Borland or Microsoft. If you use the supplied
  991.      .LIB files, then of course you have to use the right one for your choice
  992.      of compiler.
  993.  
  994.  
  995.                          The Hobbit House String Library               page  14
  996.  
  997.      While developing the library, we use various combinations of compiler
  998.      flags for various reasons. For the released product, however, we always
  999.      use the "Ox" flag which (for both Borland and Microsoft) tells the
  1000.      compiler to optimize for speed. Interestingly enough, the optimization
  1001.      for speed causes a reduction in size as well as speed (compared to the
  1002.      size produced by a totally non-optimized compile).
  1003.  
  1004.      Also note that, under both Microsoft and Borland, the "no debug info"
  1005.      flags are set for the final library compilation process, thus the library
  1006.      code will not be amenable to source level debugging unless you regenerate
  1007.      the .LIB with debug options on, in which case you should also specify no
  1008.      optimization since under either compiler, debugging can get messy with
  1009.      any optimizations on.
  1010.  
  1011.      If you feel that a module in the library is causing a problem, we suggest
  1012.      copying the source code directly into your program for test purposes and
  1013.      then deleting it when you're done. If it actually IS the cause of a
  1014.      problem, please let us know and we will fix the library. Most of these
  1015.      functions have been in use for years and those which have been generated
  1016.      more recently have gone through extensive testing by several users.
  1017.  
  1018.  
  1019.      4.0 Utilities
  1020.      =============
  1021.  
  1022.      There are two classes of utilities associated with hhstring. First, there
  1023.      are the utilities which facilitate the use of the library, and which are
  1024.      provided along with the libarary. These are funcfind (the on-line
  1025.      function finder), make_man (which will create the manual from the .C
  1026.      files and the MANUAL.RAW file), cprint (a "pretty printer" which can be
  1027.      used to print the .C files in the form which they are designed to be
  1028.      printed in) and test_str/datetest (the test programs which you should use
  1029.      if you modify the library). These utilities are described in section 4.1.
  1030.  
  1031.      Second, there are the library creation and maintenance utilities which
  1032.      are used to create and maintain the library but which are not
  1033.      distributed with the library. These are available separately if you want
  1034.      to use them to create/maintain your own library or to modify hhstring.
  1035.      They are not REQUIRED in order to modify hhstring, they just make it easy
  1036.      do a complete job of creating/maintaining/modifying any library,
  1037.      including hhstring. They are described in section 4.2.
  1038.  
  1039.  
  1040.      4.1 hhstring Utilities
  1041.      ======================
  1042.  
  1043.      This secton describes the utilities which are supplied with hhstring. For
  1044.      the utilities test_str and datetest, source code is provided as part of
  1045.      the hhstring package. Source code for the others is available as part of
  1046.      the library creation/maintainance toolkit discussed in section 4.2.
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.      page  15            The Hobbit House String Library
  1055.  
  1056.      4.1.1 funcfind
  1057.      ==============
  1058.  
  1059.      With over 250 functions in the library, and MAJOR similarities among
  1060.      various groups of functions, it can be a little intimidating to try to
  1061.      remember just how all of the names are structured so as to come up with
  1062.      the name of the function you need for a particular application.
  1063.      FUNCFIND.EXE is the on-line entry in a two-pronged attack on that problem
  1064.      (the other being the KWIC index, described in section 2.4, which is more
  1065.      designed for hard-copy reference material).
  1066.  
  1067.      FUNCFIND.EXE lists all of the keywords which occur in the source listings
  1068.      and uses them to find the function you are looking for. Click on any
  1069.      combination of keywords, and the one's you've chosen are ANDed together
  1070.      to select all functions which contain ALL of those keywords. The
  1071.      functions names are then listed, in a separate window, and if you want
  1072.      more details about the function, you may click on any of the names in the
  1073.      function name window to get a description of that function.
  1074.  
  1075.      This is very much a "hands-on" tool, and a minute or two of playing
  1076.      around with it will tell you far more than could be described in several
  1077.      pages of written description, so ... go play!
  1078.  
  1079.  
  1080.      4.1.2 make_man
  1081.      ==============
  1082.  
  1083.      The manual file (HHSTRING.MAN) consists primarily of a "printed" form of
  1084.      the .C files. We also want to give you a copy of the .C files themselves,
  1085.      but it just doesn't make sense to provide two copies of the same
  1086.      information, especially when that information consists of a very large
  1087.      number of bytes.
  1088.  
  1089.      We have dealt with this situation by providing:
  1090.  
  1091.     o the .C files
  1092.     o a "raw" manual file (MANUAL.RAW, which has no pagination and no
  1093.       table of contents for the function listings)
  1094.     o a utility (MAKE_MAN.EXE) which puts it all together, including
  1095.       pagination, to create the HHSTRING.MAN file.
  1096.  
  1097.  
  1098.      4.1.3 test_str and datetest
  1099.      ===========================
  1100.  
  1101.      Although each function has a code snippet which gets compiled and
  1102.      executed every time the code for the function changes, that leaves two
  1103.      unresolved issues regarding the testing of the string. First, the code
  1104.      snippets are always compiled under Borland but only occassionally under
  1105.      Microsoft, and second, the code snippets don't show function interaction.
  1106.      That is, a function could be modified in a way that does not show any
  1107.      problem with its code snippet since the change is consistent with what
  1108.      the code snipped tests for, but the change could cause a problem when
  1109.      another function in the library calls the one that has been changed.
  1110.  
  1111.  
  1112.                          The Hobbit House String Library               page  16
  1113.  
  1114.      The solution to both of these problems was to create test file which
  1115.      fully tests every single function in the library, (including the macros
  1116.      so that changes in the header file don't get overlooked). The test
  1117.      program is then compiled under both Borland and Microsoft and when
  1118.      executed shows that not only does each function work independantly, but
  1119.      that they are mutually compatible when calling each other.
  1120.  
  1121.      This technique has identified a number of potential problems during the
  1122.      development of the library, and we STRONGLY reccommend that if you modify
  1123.      the library, you update the test file accordingly and use it to make sure
  1124.      you have not introduced any problems into the library.
  1125.  
  1126.      Note that the "date" functions are NOT testtest by TEST_STR, but have
  1127.      their own test program "DATETEST.EXE", which is also provided with the
  1128.      library package.
  1129.  
  1130.      By the way, the test_str.exe provided was done under the large memory
  1131.      model. It's too big to compile under the tiny model unless it is broken
  1132.      into two test files. Also, test_str has a command line option to report
  1133.      only errors, rather than reporting on the results of every test. Just
  1134.      invoke it with F (for Fast) as follows:
  1135.  
  1136.             test_str F
  1137.  
  1138.      If you'd like to capture the test results to a file, just do
  1139.  
  1140.             test_str > myfile
  1141.  
  1142.  
  1143.      4.1.4 cprint
  1144.      ============
  1145.  
  1146.      The cprint utility is a very simple "pretty printer" which puts the file
  1147.      name and a page number at the top of every page of listing. The source
  1148.      code in hhstring is spaced so as to look good when printed with cprint.
  1149.  
  1150.  
  1151.      4.2 The Creation and Maintenance Utilities
  1152.      ==========================================
  1153.  
  1154.      Creating and maintaining a library of this size is a major effort.
  1155.      Several utilities were developed to facilitate the process. These
  1156.      utilities are described in the following sections (4.4.1 through 4.4.7).
  1157.      None of these utilities need be of any concern to you unless you want to
  1158.      either develop your own library, or modify and maintain this library, in
  1159.      which case you might want to purchase our library development package
  1160.      which includes all of these functions. See section 7.0 for ordering
  1161.      information.
  1162.  
  1163.  
  1164.      4.2.1 sorc_chk
  1165.      ==============
  1166.  
  1167.      SORC_CHK.EXE is designed to work with the "function header" format (see
  1168.      section 2.2) of the Hobbit House Software string library to perform
  1169.      various tests on the source code files. For example, all of the required
  1170.  
  1171.      page  17            The Hobbit House String Library
  1172.  
  1173.      lines in the function header format are tested to see that they are,
  1174.      first of all, present, and second, not empty. That is, there not only has
  1175.      to be a line which starts with "KWIC:", it has to have more than just
  1176.      "KWIC:" or else it is considered empty. The full range of tests performed
  1177.      by the sorc_chk utility is detailed in the block comments throughout the
  1178.      body of the source code (see the file SORC_CHK.C).
  1179.  
  1180.  
  1181.      4.2.2 mak_head
  1182.      ==============
  1183.  
  1184.      The mak_head utility reads all of the source files and creates a
  1185.      humonguous header file called keywords.h which is then used to compile
  1186.      the function finder utility. Keywords.h contains the keywords and key
  1187.      sentences for each function, plus some additional information needed by
  1188.      funcfind. The first version of funcfind read in some of the information
  1189.      now contained in keywords.h and computed the rest. This took over 10
  1190.      seconds on a 40Mhz 386, so we decided to speed things up by including all
  1191.      of the information in funcfind.exe. Now, as you can see, funcfind is
  1192.      essentially instantaneous. Try clicking on the "new" keyword to see what
  1193.      we mean ("new" happens to be one which pretty much fills up the lower
  1194.      window).
  1195.  
  1196.  
  1197.      4.2.3 index
  1198.      ===========
  1199.  
  1200.      The KWIC index is created from the "KWIC:" lines in the source code files
  1201.      by the INDEX.EXE utility. For more information, see the INDEX.C file
  1202.      (Section 4.2.3) and the SORC_CHK utility (Section 4.2.1).
  1203.  
  1204.  
  1205.      4.2.4 compress/expand
  1206.      =====================
  1207.  
  1208.      The compression/expansion utilities used with hhstring are modified
  1209.      versions of public domain utilites found on bulletin boards. They are
  1210.      NOT comparable to the ".ZIP" or ".ARJ" or any other commercial products
  1211.      of that nature, but they get the job done. We use them because they do a
  1212.      reasonable job and unlike the .ZIP and .ARJ, etc products, they don't
  1213.      cost us several dollars per diskette for distribution rights.
  1214.  
  1215.      Unfortunately, we will not even ATTEMPT to support these utilities as
  1216.      products, so they are not included even if you buy the support package
  1217.      for the creation/maintenance of libraries. You'll have to either deal
  1218.      with the commercial vendors for compress/expand utilities, or do as we
  1219.      have done and come up with your own. Good luck!
  1220.  
  1221.      If you join the Hobbit House Group, the compression utilities will be
  1222.      used on your distribution diskettes, which is another way that the Hobbit
  1223.      House Group saves money for its members.
  1224.  
  1225.  
  1226.      4.2.5 drwin
  1227.      ===========
  1228.  
  1229.  
  1230.                          The Hobbit House String Library               page  18
  1231.  
  1232.      The findfunc utility uses a "free-ware" (not public domain, but can be
  1233.      freely used and distributed at no cost) text-based windowing/menu/mouse
  1234.      library called "drwin". An upgrade of this library, written by Doug
  1235.      Rodgers of McLean, Virginia, is one of the products being developed under
  1236.      the auspices of the Hobbit House Group, the distributer of the Hobbit
  1237.      House Software string library.
  1238.  
  1239.      If you buy the creation/maintenance utilities, a copy of the no-cost
  1240.      drwin library will be included. It is NOT documented, to speak of, but
  1241.      it has been in use for several years, it does a good job, and it has no
  1242.      known bugs. The function calls used in findfunc are documented well
  1243.      enough in findfunc that the lack of documentation in drwin need not be
  1244.      a problem.
  1245.  
  1246.  
  1247.      4.2.6 protoflt
  1248.      ==============
  1249.  
  1250.      When working with a library there is occasionally the need to do
  1251.      something to all of the source files or some subset of the source files.
  1252.      For example, at one point there was a "latest update: <date>" line in
  1253.      the description of every function but it was decided that the "compiled/
  1254.      executed/verified: <date>" line should become the "latest update" line
  1255.      for the functions and the "latest update: <date>" line had to be deleted
  1256.      from each of over 250 files. Clearly, this is NOT something that one
  1257.      would even want to THINK about doing by hand. Similarly, it was
  1258.      discovered that "occurrence" had been mis-spelled some 234 times in the
  1259.      source files. What to do, what to do ...
  1260.  
  1261.      "protoflt" stands for "Prototype Filter". It is a simple program which
  1262.      handles all of the file and line I/O required to perform various kinds
  1263.      of filtering on multiple files. It is a "shell" into which you can insert
  1264.      a very few lines of C code to produce a particular filter for source
  1265.      files. For example, modifying a spelling mistake in the source files
  1266.      required the insertion of two lines of C code into protoflt, a compile,
  1267.      and an execution, and it was all taken care of.
  1268.  
  1269.  
  1270.      5.0 Royalties and Distribution Rights
  1271.      =====================================
  1272.  
  1273.      There are no royalties of any kind on the Hobbit House Software string
  1274.      library. You may distribute your own applications, whether commercial,
  1275.      shareware, public domain, or whatever, with embedded object code from
  1276.      the string library, without restraint.
  1277.  
  1278.      What you may NOT do is distribute the library itself, in whole or in
  1279.      part, in object form or in source form, other than as direct copies of
  1280.      the shareware version, which may be distributed subject to the
  1281.      restraints listed in section 1.2.1.
  1282.  
  1283.  
  1284.      6.0 The Hobbit House Group
  1285.      ==========================
  1286.  
  1287.      The Hobbit House Group is a cooperative effort designed to save money on
  1288.  
  1289.      page  19            The Hobbit House String Library
  1290.  
  1291.      production and advertising costs among software developers. Paul Hinds,
  1292.      the proprietor of Hobbit House Software, is the founder of The Hobbit
  1293.      House Group, thus the obvious similarity in names.
  1294.  
  1295.      If you are in the process of developing software for commercial sale, or
  1296.      even shareware, you should consider joining the Hobbit House Group. For
  1297.      full details, see the file HHGROUP.DOC.
  1298.  
  1299.  
  1300.      7.0 Ordering Information
  1301.      ========================
  1302.  
  1303.      To order hhstring and/or the library creation/maintenance utilities, see
  1304.      the file ORDER.DOC; you can print that file and use it as your order
  1305.      form if you want, or you can just send a check with a note stating what
  1306.      the check is for. We are unable to accept credit card orders at this
  1307.      time. If you received the demo package through the ad in the C User's
  1308.      Journal, you will also have received a printed order form rather than the
  1309.      ORDER.DOC file.
  1310.  
  1311.  
  1312.      8.0 Technical Support
  1313.      =====================
  1314.  
  1315.      Murphy's Law:
  1316.  
  1317.           If anything can go wrong, it will.
  1318.  
  1319.           Or, as they say in California, "shit happens".
  1320.  
  1321.      Murphy's Corollary #27:
  1322.  
  1323.           There is no such thing as the FINAL release of any software
  1324.           product.
  1325.  
  1326.      Most of hhstring has been in use for years and we would like to think
  1327.      that it has been beaten to death in recent Beta testing and that no
  1328.      problems will ever arise. Murphy says otherwise.
  1329.  
  1330.  
  1331.      Please note:
  1332.  
  1333.        ╔═══════════════════════════════════════════════════════╗
  1334.        ║ If you find ANY problem, or have any suggestions for  ║
  1335.        ║ improvements and/or additions to the library, PLEASE  ║
  1336.        ║ contact us. The first registered user reporting any   ║
  1337.        ║ particular bug or making any suggestion which is       ║
  1338.        ║ incorporated in future versions will receive a free   ║
  1339.        ║ copy of the next upgrade release.               ║
  1340.        ╚═══════════════════════════════════════════════════════╝
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.                          The Hobbit House String Library               page  20
  1349.  
  1350.      9.0 Function Listings
  1351.      =====================
  1352.  
  1353.      This section was generated from the .C files using the MAKE_MAN utility
  1354.      to do pagination. At the time of creation, owners of the commercial
  1355.      package (but not the demo package) will have been asked whether or
  1356.      not they wish for the source code to be included in the manual.
  1357.  
  1358.  
  1359.      atoh ........................................................    21
  1360.      atoh2 .......................................................    22
  1361.      atolh .......................................................    23
  1362.      atolh2 ......................................................    24
  1363.      atoo ........................................................    26
  1364.      atoo2 .......................................................    27
  1365.      btoc ........................................................    29
  1366.      ctob ........................................................    30
  1367.      ctod ........................................................    31
  1368.      ctoh ........................................................    32
  1369.      date_without ................................................    33
  1370.      date_withpad ................................................    35
  1371.      dtoc ........................................................    37
  1372.      fnconv_1to2 .................................................    38
  1373.      fnconv_2to1 .................................................    40
  1374.      htoc ........................................................    42
  1375.      isfilename ..................................................    43
  1376.      make_date_without ...........................................    45
  1377.      make_date_withpad ...........................................    47
  1378.      ptrfirstblank ...............................................    49
  1379.      ptrfirstchr .................................................    50
  1380.      ptrfirstchri ................................................    51
  1381.      ptrfirstdig .................................................    52
  1382.      ptrfirstgr ..................................................    53
  1383.      ptrfirsthex .................................................    54
  1384.      ptrfirstnotblank ............................................    55
  1385.      ptrfirstnotchr ..............................................    56
  1386.      ptrfirstnotchri .............................................    57
  1387.      ptrfirstnotdig ..............................................    58
  1388.      ptrfirstnotgr ...............................................    59
  1389.      ptrfirstnothex ..............................................    60
  1390.      ptrfirstnotrange ............................................    61
  1391.      ptrfirstnottextterm .........................................    62
  1392.      ptrfirstnotwhite ............................................    63
  1393.      ptrfirstnotwordterm .........................................    64
  1394.      ptrfirstrange ...............................................    65
  1395.      ptrfirstsub .................................................    66
  1396.      ptrfirstsubi ................................................    67
  1397.      ptrfirsttext ................................................    68
  1398.      ptrfirsttextterm ............................................    69
  1399.      ptrfirstwhite ...............................................    70
  1400.      ptrfirstword ................................................    71
  1401.      ptrfirstwordterm ............................................    72
  1402.      ptrlastblank ................................................    73
  1403.      ptrlastchr ..................................................    74
  1404.      ptrlastchri .................................................    75
  1405.  
  1406.                          The Hobbit House String Library
  1407.  
  1408.      ptrlastdig ..................................................    76
  1409.      ptrlastgr ...................................................    77
  1410.      ptrlasthex ..................................................    78
  1411.      ptrlastnotblank .............................................    79
  1412.      ptrlastnotchr ...............................................    80
  1413.      ptrlastnotchri ..............................................    81
  1414.      ptrlastnotdig ...............................................    82
  1415.      ptrlastnotgr ................................................    83
  1416.      ptrlastnothex ...............................................    84
  1417.      ptrlastnotrange .............................................    85
  1418.      ptrlastnottextterm ..........................................    86
  1419.      ptrlastnotwhite .............................................    87
  1420.      ptrlastnotwordterm ..........................................    88
  1421.      ptrlastrange ................................................    89
  1422.      ptrlastsub ..................................................    90
  1423.      ptrlastsubi .................................................    91
  1424.      ptrlasttext .................................................    92
  1425.      ptrlasttextterm .............................................    93
  1426.      ptrlastwhite ................................................    94
  1427.      ptrlastword .................................................    95
  1428.      ptrlastwordterm .............................................    96
  1429.      ptrnextblank ................................................    97
  1430.      ptrnextchr ..................................................    99
  1431.      ptrnextchri .................................................   101
  1432.      ptrnextdig ..................................................   103
  1433.      ptrnextdig ..................................................   105
  1434.      ptrnextgr ...................................................   107
  1435.      ptrnexthex ..................................................   109
  1436.      ptrnextnotblank .............................................   111
  1437.      ptrnextnotchr ...............................................   113
  1438.      ptrnextnotchri ..............................................   115
  1439.      ptrnextnotgr ................................................   117
  1440.      ptrnextnothex ...............................................   119
  1441.      ptrnextnotrange .............................................   121
  1442.      ptrnextnottextterm ..........................................   123
  1443.      ptrnextnotwhite .............................................   125
  1444.      ptrnextnotwordterm ..........................................   127
  1445.      ptrnextrange ................................................   129
  1446.      ptrnextsub ..................................................   131
  1447.      ptrnextsubi .................................................   133
  1448.      ptrnexttext .................................................   135
  1449.      ptrnexttextterm .............................................   137
  1450.      ptrnextwhite ................................................   139
  1451.      ptrnextword .................................................   141
  1452.      ptrnextwordterm .............................................   143
  1453.      ptrprevblank ................................................   145
  1454.      ptrprevchr ..................................................   146
  1455.      ptrprevchri .................................................   147
  1456.      ptrprevdig ..................................................   148
  1457.      ptrprevgr ...................................................   149
  1458.      ptrprevhex ..................................................   150
  1459.      ptrprevnotblank .............................................   151
  1460.      ptrprevnotchr ...............................................   152
  1461.      ptrprevnotchri ..............................................   153
  1462.      ptrprevnotdig ...............................................   154
  1463.      ptrprevnotgr ................................................   155
  1464.  
  1465.                          The Hobbit House String Library
  1466.  
  1467.      ptrprevnothex ...............................................   156
  1468.      ptrprevnotrange .............................................   157
  1469.      ptrprevnottextterm ..........................................   158
  1470.      ptrprevnotwhite .............................................   159
  1471.      ptrprevnotwordterm ..........................................   160
  1472.      ptrprevrange ................................................   161
  1473.      ptrprevsub ..................................................   162
  1474.      ptrprevsubi .................................................   163
  1475.      ptrprevtext .................................................   164
  1476.      ptrprevtextterm .............................................   166
  1477.      ptrprevwhite ................................................   167
  1478.      ptrprevword .................................................   168
  1479.      ptrprevwordterm .............................................   170
  1480.      ptrthistext .................................................   171
  1481.      ptrthisword .................................................   172
  1482.      strblank ....................................................   173
  1483.      strblanktotab ...............................................   174
  1484.      strcenter ...................................................   176
  1485.      strcentern ..................................................   178
  1486.      strcenternew ................................................   180
  1487.      strcenternnew ...............................................   182
  1488.      strchecksuma ................................................   184
  1489.      strchecksumia ...............................................   185
  1490.      strchecksumil ...............................................   186
  1491.      strchecksuml ................................................   187
  1492.      strchrcount .................................................   188
  1493.      strchrcounti ................................................   189
  1494.      strchrdel ...................................................   190
  1495.      strchrdelgr .................................................   191
  1496.      strchrdelgrnew ..............................................   192
  1497.      strchrdeli ..................................................   194
  1498.      strchrdelinew ...............................................   195
  1499.      strchrdelnew ................................................   197
  1500.      strchrdelrange ..............................................   199
  1501.      strchrdelrangenew ...........................................   200
  1502.      strchrfromc .................................................   202
  1503.      strchrrpl ...................................................   204
  1504.      strchrrpli ..................................................   205
  1505.      strchrrplinew ...............................................   206
  1506.      strchrrplnew ................................................   208
  1507.      strchrtoc ...................................................   210
  1508.      strcode1 ....................................................   212
  1509.      strcode2 ....................................................   214
  1510.      strcomma ....................................................   216
  1511.      strcommaf ...................................................   217
  1512.      strcommafnew ................................................   218
  1513.      strcommafri .................................................   220
  1514.      strcommafrl .................................................   221
  1515.      strcommafrui ................................................   222
  1516.      strcommafrul ................................................   223
  1517.      strcomman ...................................................   224
  1518.      strcommanew .................................................   226
  1519.      strcommannew ................................................   228
  1520.      strcommatoi .................................................   230
  1521.      strcommatol .................................................   231
  1522.      strcommatoui ................................................   232
  1523.  
  1524.                          The Hobbit House String Library
  1525.  
  1526.      strcommatoul ................................................   233
  1527.      strdate1 ....................................................   234
  1528.      strdate2 ....................................................   235
  1529.      strdate3 ....................................................   236
  1530.      strdate4 ....................................................   237
  1531.      strdate5 ....................................................   238
  1532.      strdate6 ....................................................   239
  1533.      strdate7 ....................................................   240
  1534.      strdateconv .................................................   241
  1535.      strend ......................................................   242
  1536.      streos ......................................................   243
  1537.      strfromc ....................................................   244
  1538.      strindex ....................................................   246
  1539.      strinsert ...................................................   247
  1540.      strinsertnew ................................................   248
  1541.      strisempty ..................................................   250
  1542.      striswhite ..................................................   252
  1543.      strleft .....................................................   253
  1544.      strleftnew ..................................................   254
  1545.      strlenmax ...................................................   255
  1546.      strlenmin ...................................................   256
  1547.      strlfdel ....................................................   257
  1548.      strlfdelnew .................................................   258
  1549.      strlfjust ...................................................   259
  1550.      strlfjustnew ................................................   260
  1551.      strlfpad ....................................................   262
  1552.      strlfpadnew .................................................   263
  1553.      strlfrot ....................................................   264
  1554.      strlfrotnew .................................................   265
  1555.      strlfset ....................................................   266
  1556.      strlfsetnew .................................................   267
  1557.      strlfsh .....................................................   269
  1558.      strlfshnew ..................................................   270
  1559.      strlfsize ...................................................   271
  1560.      strlfsizenew ................................................   272
  1561.      strlftrim ...................................................   274
  1562.      strlftrimnew ................................................   275
  1563.      strmid ......................................................   276
  1564.      strmiddel ...................................................   277
  1565.      strmiddelnew ................................................   278
  1566.      strmidn .....................................................   280
  1567.      strmidnew ...................................................   282
  1568.      strmidnnew ..................................................   284
  1569.      strmidpad ...................................................   286
  1570.      strmidpadnew ................................................   288
  1571.      strmidset ...................................................   290
  1572.      strmidsetnew ................................................   291
  1573.      strrepeat ...................................................   293
  1574.      strrepeatn ..................................................   294
  1575.      strreverse ..................................................   296
  1576.      strreversenew ...............................................   297
  1577.      strright ....................................................   298
  1578.      strrightnew .................................................   299
  1579.      strrtdel ....................................................   301
  1580.      strrtdelnew .................................................   302
  1581.      strrtjust ...................................................   303
  1582.  
  1583.                          The Hobbit House String Library
  1584.  
  1585.      strrtjustnew ................................................   304
  1586.      strrtpad ....................................................   306
  1587.      strrtpadnew .................................................   307
  1588.      strrtrot ....................................................   308
  1589.      strrtrotnew .................................................   309
  1590.      strrtset ....................................................   310
  1591.      strrtsetnew .................................................   311
  1592.      strrtsh .....................................................   312
  1593.      strrtshnew ..................................................   313
  1594.      strrtsize ...................................................   314
  1595.      strrtsizenew ................................................   315
  1596.      strrttrim ...................................................   317
  1597.      strrttrimnew ................................................   318
  1598.      strsubcount .................................................   319
  1599.      strsubcounti ................................................   320
  1600.      strsubdel ...................................................   321
  1601.      strsubdelall ................................................   322
  1602.      strsubdelallnew .............................................   323
  1603.      strsubdeli ..................................................   324
  1604.      strsubdeliall ...............................................   325
  1605.      strsubdeliallnew ............................................   326
  1606.      strsubdelinew ...............................................   327
  1607.      strsubdelnew ................................................   328
  1608.      strsubrpl ...................................................   329
  1609.      strsubrplall ................................................   330
  1610.      strsubrplallnew .............................................   332
  1611.      strsubrpli ..................................................   334
  1612.      strsubrpliall ...............................................   335
  1613.      strsubrpliallnew ............................................   337
  1614.      strsubrplinew ...............................................   339
  1615.      strsubrplnew ................................................   341
  1616.      strtabtoblank ...............................................   343
  1617.      strtextfirst ................................................   345
  1618.      strtextget ..................................................   347
  1619.      strtextlast .................................................   349
  1620.      strtextnext .................................................   351
  1621.      strtextprev .................................................   353
  1622.      strtextthis .................................................   355
  1623.      strtoc ......................................................   357
  1624.      strtolower ..................................................   358
  1625.      strtolowernew ...............................................   359
  1626.      strtoupper ..................................................   360
  1627.      strtrim .....................................................   361
  1628.      strtrimnew ..................................................   362
  1629.      strwordfirst ................................................   364
  1630.      strwordget ..................................................   365
  1631.      strwordlast .................................................   367
  1632.      strwordnext .................................................   368
  1633.      strwordprev .................................................   370
  1634.      strwordthis .................................................   372
  1635.      strxcat .....................................................   374
  1636.      strxcatn ....................................................   375
  1637.      strzero .....................................................   377
  1638.  
  1639.  
  1640.  
  1641.  
  1642.                          The Hobbit House String Library
  1643.  
  1644.  
  1645.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  1646.      ║ ATOH.C       ║   file date: 03/13/93    page   1 of   1 ║ ATOH.C       ║
  1647.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  1648.  
  1649.      /*                       ┌───────────────────────┐                    atoh
  1650.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  1651.                               └───────────────────────┘
  1652.                                copyright(c) 1992, 1993
  1653.      
  1654.      function:       atoh (ASCII TO Hex conversion)
  1655.      
  1656.      KWIC:           %convert an %ASCII %hex string to a numerical value
  1657.      
  1658.      syntax:         #include "hhstring.h"
  1659.                      unsigned int atoh(char *hexstring)
  1660.      
  1661.      description:    converts hexstring to an unsigned integer, interpreting
  1662.                      it as an ASCII-hex string
  1663.      
  1664.      returns:        the unsigned integer represented by the ASCII string
  1665.      
  1666.      comments:       There is no test for overflow. If the input string
  1667.                      generates more than 4 nibbles of hex, the rightmost
  1668.                      4 nibbles will be used to fill the result.
  1669.      
  1670.      keywords:       string, ASCII, hex, convert, numeric, integer
  1671.      
  1672.      key sentence:   converts an ASCII-hex string to an unsigned integer,
  1673.                      ignoring leading whitespace
  1674.      
  1675.      see also:       atoh    atoh2   atolh    atolh2
  1676.      
  1677.      usage example:  compiled/executed/verified on 1/17/93
  1678.      
  1679.                      printf("\n%4.4x", atoh("  dead  "));
  1680.                      printf("\n%4.4X", atoh("beef"));
  1681.      
  1682.                      dead
  1683.                      BEEF
  1684.      
  1685.                               ┌───────────────────────┐
  1686.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  1687.                               └───────────────────────┘                      */
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.                          The Hobbit House String Library               page  21
  1704.  
  1705.  
  1706.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  1707.      ║ ATOH2.C      ║   file date: 03/13/93    page   1 of   1 ║ ATOH2.C      ║
  1708.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  1709.  
  1710.      /*                       ┌───────────────────────┐                   atoh2
  1711.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  1712.                               └───────────────────────┘
  1713.                                copyright(c) 1992, 1993
  1714.      
  1715.      function:       atoh2 (ASCII TO Hex conversion)
  1716.      
  1717.      KWIC:           %convert an ASCII %hex string to a numerical value and
  1718.                      tell how many hex characters were in the string
  1719.      
  1720.      syntax:         #include "hhstring.h"
  1721.                      unsigned int atoh2(int *nchars, char *hexstring)
  1722.      
  1723.      description:    converts hexstring to an unsigned integer, interpreting
  1724.                      it as an ASCII-hex string and ignoring any leading
  1725.                      whitespace. Puts the number of hex characters which were
  1726.                      found in the string into nchars
  1727.      
  1728.      returns:        the integer represented by the ASCII string (also puts
  1729.                      the number of hex characters in the string back into a
  1730.                      calling program variable)
  1731.      
  1732.      comments:       There is no test for overflow. If the input string
  1733.                      generates more than 4 nibbles of hex, the rightmost
  1734.                      4 nibbles will be used to fill the result.
  1735.      
  1736.      keywords:       string, ASCII, hex, convert, numeric, integer
  1737.      
  1738.      key sentence:   converts an ASCII-hex string to an unsigned integer,
  1739.                      ignoring any leading whitespace, and tells how many hex
  1740.                      characters are in the string
  1741.      
  1742.      see also:       atoh    atoh2   atolh    atolh2
  1743.      
  1744.      usage example:  compiled/executed/verified on 1/17/93
  1745.      
  1746.                      int nchars;
  1747.                      printf("\n%4.4x", atoh2(&nchars, "  dead  "));
  1748.                      printf(" %d", nchars);
  1749.                      printf("\n%4.4X", atoh2(&nchars, "1a"));
  1750.                      printf(" %d", nchars);
  1751.      
  1752.                      dead 4
  1753.                      001A 2
  1754.                               ┌───────────────────────┐
  1755.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  1756.                               └───────────────────────┘                      */
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.      page  22            The Hobbit House String Library
  1765.  
  1766.  
  1767.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  1768.      ║ ATOLH.C      ║   file date: 03/13/93    page   1 of   1 ║ ATOLH.C      ║
  1769.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  1770.  
  1771.      /*                       ┌───────────────────────┐                   atolh
  1772.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  1773.                               └───────────────────────┘
  1774.                                copyright(c) 1992, 1993
  1775.      
  1776.      function:       atolh (ASCII TO Long Hex conversion)
  1777.      
  1778.      KWIC:           %convert an ASCII %hex string to a numerical value
  1779.      
  1780.      syntax:         #include "hhstring.h"
  1781.                      unsigned long atolh(char *hexstring)
  1782.      
  1783.      description:    converts hexstring to an unsigned long (32-bit) hex
  1784.                      integer, interpreting it as an ASCII-hex string;
  1785.                      leading whitespace is ignored
  1786.      
  1787.      returns:        the long integer represented by the ASCII string
  1788.      
  1789.      comments:       There is no test for overflow. If the input string
  1790.                      generates more than 8 nibbles of hex, the rightmost
  1791.                      8 nibbles will be used to fill the long result.
  1792.      
  1793.      keywords:       string, ASCII, hex, convert, numeric, long
  1794.      
  1795.      key sentence:   converts an ASCII-hex string to an unsigned long
  1796.                      numeric value, ignoring any leading whitespace
  1797.      
  1798.      see also:       atoh    atoh2   atolh    atolh2
  1799.      
  1800.      usage example:  compiled/executed/verified on 1/17/93
  1801.      
  1802.                      printf("\n%8.8lx", atolh("  deadbeef  "));
  1803.                      printf("\n%8.8lx", atolh("123456789"));
  1804.      
  1805.                      deadbeef
  1806.                      23456789
  1807.      
  1808.                               ┌───────────────────────┐
  1809.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  1810.                               └───────────────────────┘                      */
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.                          The Hobbit House String Library               page  23
  1826.  
  1827.  
  1828.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  1829.      ║ ATOLH2.C     ║   file date: 03/13/93    page   1 of   2 ║ ATOLH2.C     ║
  1830.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  1831.  
  1832.      /*                       ┌───────────────────────┐                  atolh2
  1833.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  1834.                               └───────────────────────┘
  1835.                                copyright(c) 1992, 1993
  1836.      
  1837.      function:       atolh2 (ASCII TO Long Hex conversion)
  1838.      
  1839.      KWIC:           %convert an ASCII %hex string to a numeric value
  1840.      
  1841.      syntax:         #include "hhstring.h"
  1842.                      unsigned long atolh2(int *nchars, char *hexstring)
  1843.      
  1844.      description:    converts hexstring to an unsigned long value, ignoring
  1845.                      any leading whitespace and interpreting it as an ASCII-
  1846.                      hex string. The number of hex characters in the string
  1847.                      is put back into nchar (which, please note, is a pointer
  1848.                      here, not a value)
  1849.      
  1850.      returns:        the unsigned long integer represented by the ASCII string
  1851.                      (also puts the number of hex characters in the string back
  1852.                      into a calling program variable)
  1853.      
  1854.      comments:       There is no test for overflow. If the input string
  1855.                      generates more than 8 nibbles of hex, the rightmost
  1856.                      8 nibbles will be used to fill the long result.
  1857.      
  1858.      keywords:       string, ASCII, hex, convert, numeric, long
  1859.      
  1860.      key sentence:   converts an ASCII-hex string into an unsigned long,
  1861.                      ignoring any leading whitespace; also tells how many
  1862.                      hex characters are in the string
  1863.      
  1864.      see also:       atoh    atoh2   atolh    atolh2
  1865.      
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.      page  24            The Hobbit House String Library
  1887.  
  1888.  
  1889.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  1890.      ║ ATOLH2.C     ║   file date: 03/13/93    page   2 of   2 ║ ATOLH2.C     ║
  1891.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  1892.  
  1893.      
  1894.      
  1895.      usage example:  compiled/executed/verified on 1/17/93
  1896.      
  1897.                      int nchars;
  1898.                      printf("\n%lx", atolh2(&nchars, "  deadbeef  "));
  1899.                      printf(" %d", nchars);
  1900.                      printf("\n%lx", atolh2(&nchars, "dead"));
  1901.                      printf(" %d", nchars);
  1902.                      printf("\n%lx", atolh2(&nchars, "123456789"));
  1903.                      printf(" %d", nchars);
  1904.      
  1905.                      deadbeef 8
  1906.                      dead 4
  1907.                      23456789 9
  1908.      
  1909.                               ┌───────────────────────┐
  1910.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  1911.                               └───────────────────────┘                      */
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.                          The Hobbit House String Library               page  25
  1948.  
  1949.  
  1950.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  1951.      ║ ATOO.C       ║   file date: 03/13/93    page   1 of   1 ║ ATOO.C       ║
  1952.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  1953.  
  1954.      /*                       ┌───────────────────────┐                    atoo
  1955.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  1956.                               └───────────────────────┘
  1957.                                copyright(c) 1992, 1993
  1958.      
  1959.      function:       atoo (ASCII TO Octal conversion)
  1960.      
  1961.      KWIC:           %convert an ASCII %octal string to a numeric value
  1962.      
  1963.      syntax:         #include "hhstring.h"
  1964.                      unsigned int atoo(char *octalstring)
  1965.      
  1966.      description:    converts octalstring to an unsigned integer, interpreting
  1967.                      it as ASCII-octal and ignoring any leading whitespace
  1968.      
  1969.      returns:        the integer represented by the ASCII string
  1970.      
  1971.      comments:       There is no test for overflow. If the input string
  1972.                      generates more than 15 bits of integer value, then
  1973.                      the rightmost 5 characters will be used in filling
  1974.                      the integer. The function will properly interpret
  1975.                      a 6-character string starting with 1 (which is, of
  1976.                      course, a valid octal number).
  1977.      
  1978.      keywords:       string, ASCII, octal, convert, numeric
  1979.      
  1980.      key sentence:   converts an ASCII-octal string to an unsigned integer,
  1981.                      ignoring any leading whitespace
  1982.      
  1983.      see also:       atoh    atohl   atoo    atoo2
  1984.      
  1985.      usage example:  compiled/executed/verified on 1/17/93
  1986.      
  1987.                      printf("\n%4.4x", atoo("  123456"));
  1988.      
  1989.                      a72e
  1990.      
  1991.      
  1992.      
  1993.                               ┌───────────────────────┐
  1994.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  1995.                               └───────────────────────┘                      */
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.      page  26            The Hobbit House String Library
  2009.  
  2010.  
  2011.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2012.      ║ ATOO2.C      ║   file date: 03/13/93    page   1 of   2 ║ ATOO2.C      ║
  2013.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2014.  
  2015.      /*                       ┌───────────────────────┐                   atoo2
  2016.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  2017.                               └───────────────────────┘
  2018.                                copyright(c) 1992, 1993
  2019.      
  2020.      function:       atoo2 (ASCII TO Octal conversion, version 2)
  2021.      
  2022.      KWIC:           %convert an ASCII %octal string to a numeric value
  2023.      
  2024.      syntax:         #include "hhstring.h"
  2025.                      unsigned int atoo2(int *nchars, char *octalstring)
  2026.      
  2027.      description:    converts octalstring to an unsigned integer, interpreting
  2028.                      it as an ASCII-octal string and ignoring any leading
  2029.                      whitespace
  2030.      
  2031.      returns:        the integer represented by the ASCII string (also puts
  2032.                      the number of characters in the string back into a
  2033.                      variable in the calling program)
  2034.      
  2035.      comments:       There is no test for overflow. If the input string
  2036.                      generates more than 15 bits of integer value, then
  2037.                      the rightmost 5 characters will be used in filling
  2038.                      the integer. The function will properly interpret
  2039.                      a 6-character string starting with 1 (which is, of
  2040.                      course, a valid octal number).
  2041.      
  2042.      keywords:       string, ASCII, octal, convert, numeric
  2043.      
  2044.      key sentence:   converts an ASCII-octal string into an unsigned integer,
  2045.                      ignoring leading whitespace and telling how many octal
  2046.                      characters are in the converted string
  2047.      
  2048.      see also:       atoh            atohl           atoo            atool
  2049.                      atoh2           atohl2          atoo2           atool2
  2050.      
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.                          The Hobbit House String Library               page  27
  2070.  
  2071.  
  2072.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2073.      ║ ATOO2.C      ║   file date: 03/13/93    page   2 of   2 ║ ATOO2.C      ║
  2074.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2075.  
  2076.      
  2077.      
  2078.      usage example:  compiled/executed/verified on 1/17/93
  2079.      
  2080.                      int nchars;
  2081.                      printf("\n%x", atoo2(&nchars, "  123456 "));
  2082.                      printf(" %d", nchars);
  2083.                      printf("\n%x", atoo2(&nchars, "17"));
  2084.                      printf(" %d", nchars);
  2085.      
  2086.                      a72e 6
  2087.                      f 2
  2088.      
  2089.                               ┌───────────────────────┐
  2090.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  2091.                               └───────────────────────┘                      */
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130.      page  28            The Hobbit House String Library
  2131.  
  2132.  
  2133.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2134.      ║ BTOC.C       ║   file date: 03/13/93    page   1 of   1 ║ BTOC.C       ║
  2135.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2136.  
  2137.      /*                       ┌───────────────────────┐                    btoc
  2138.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  2139.                               └───────────────────────┘
  2140.                                copyright(c) 1992, 1993
  2141.      
  2142.      function:       btoc (Binary digit TO ASCII Character)
  2143.      
  2144.      KWIC:           %convert a %binary digit to the corresponding ASCII
  2145.                      character.
  2146.      
  2147.      syntax:         #include "hhstring.h"
  2148.                      char btoc(int digit)
  2149.      
  2150.      description:    if digit is 1, return '1', if digit is 0, return '0',
  2151.                      otherwise returns 0 to show error
  2152.      
  2153.      returns:        success: the ASCII character corresponding to the
  2154.                               input digit
  2155.                      failure: 0 (the character isn't a binary digit)
  2156.      
  2157.      comments:       none
  2158.      
  2159.      keywords:       character, ASCII, binary, convert, numeric
  2160.      
  2161.      key sentence:   converts an integer containing either a 0 or a 1 into
  2162.                      '0' or '1' but returns a binary 0 for other input
  2163.      
  2164.      see also:       btoc            dtoc            htoc
  2165.                      ctob            ctod            ctoh
  2166.      
  2167.      usage example:  compiled/executed/verified on 1/17/93
  2168.      
  2169.                      int digit = 1;
  2170.                      printf("%d  %c", digit, btoc(digit));
  2171.      
  2172.                      1  1
  2173.      
  2174.                               ┌───────────────────────┐
  2175.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  2176.                               └───────────────────────┘                      */
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.  
  2191.                          The Hobbit House String Library               page  29
  2192.  
  2193.  
  2194.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2195.      ║ CTOB.C       ║   file date: 03/13/93    page   1 of   1 ║ CTOB.C       ║
  2196.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2197.  
  2198.      /*                       ┌───────────────────────┐                    ctob
  2199.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  2200.                               └───────────────────────┘
  2201.                                copyright(c) 1992, 1993
  2202.      
  2203.      function:       ctob (Character TO Binary digit)
  2204.      
  2205.      KWIC:           %convert an ASCII character to the equivalent %binary
  2206.                      digit
  2207.      
  2208.      syntax:         #include "hhstring.h"
  2209.                      int ctob(char c)
  2210.      
  2211.      description:    if c is '0', returns 0 and if c is '1', returns 1,
  2212.                      otherwise returns 2 to show bad input
  2213.      
  2214.      returns:        on success: the digit derived from the input character
  2215.                      on failure: 2 (input character is not a binary digit)
  2216.      
  2217.      comments:       none
  2218.      
  2219.      keywords:       character, ASCII, binary, convert, numeric
  2220.      
  2221.      key sentence:   converts an ASCII-binary character to an integer. That is,
  2222.                      an input of '0' returns 0, and input of '1' returns 1, and
  2223.                      anything else in returns 2 (failure flag)
  2224.      
  2225.      see also:       btoc            dtoc            htoc
  2226.                      ctob            ctod            ctoh
  2227.      
  2228.      usage example:  compiled/executed/verified on 1/17/93
  2229.      
  2230.                      char c = '1';
  2231.                      printf("%c  %d", c, ctob(c));
  2232.      
  2233.                      1  1
  2234.      
  2235.                               ┌───────────────────────┐
  2236.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  2237.                               └───────────────────────┘                      */
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.      page  30            The Hobbit House String Library
  2253.  
  2254.  
  2255.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2256.      ║ CTOD.C       ║   file date: 03/13/93    page   1 of   1 ║ CTOD.C       ║
  2257.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2258.  
  2259.      /*                       ┌───────────────────────┐                    ctod
  2260.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  2261.                               └───────────────────────┘
  2262.                                copyright(c) 1992, 1993
  2263.      
  2264.      function:       ctod (Character TO Decimal digit)
  2265.      
  2266.      KWIC:           %convert an ASCII %decimal digit to a numeric value
  2267.      
  2268.      syntax:         #include "hhstring.h"
  2269.                      int ctod(char c)
  2270.      
  2271.      description:    converts c to the corresponding integer value,
  2272.                      interpreting c as an ASCII-decimal digit
  2273.      
  2274.      returns:        on success: the digit derived from the input character
  2275.                      on failure: 10 (input character is not a decimal digit)
  2276.      
  2277.      comments:       none
  2278.      
  2279.      keywords:       character, ASCII, decimal, convert, numeric
  2280.      
  2281.      key sentence:   converts an ASCII-decimal digit to a an integer; returns
  2282.                      the integer 10 if the input is not a decimal digit
  2283.      
  2284.      see also:       btoc            dtoc            htoc
  2285.                      ctob            ctod            ctoh
  2286.      
  2287.      usage example:  compiled/executed/verified on 1/17/93
  2288.      
  2289.                      char c = '5';
  2290.                      printf("%c  %d", c, ctod(c));
  2291.      
  2292.                      5  5
  2293.      
  2294.                               ┌───────────────────────┐
  2295.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  2296.                               └───────────────────────┘                      */
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.                          The Hobbit House String Library               page  31
  2314.  
  2315.  
  2316.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2317.      ║ CTOH.C       ║   file date: 03/13/93    page   1 of   1 ║ CTOH.C       ║
  2318.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2319.  
  2320.      /*                       ┌───────────────────────┐                    ctoh
  2321.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  2322.                               └───────────────────────┘
  2323.                                copyright(c) 1992, 1993
  2324.      
  2325.      function:       ctoh (Character TO Hexidecimal digit)
  2326.      
  2327.      KWIC:           %convert an ASCII %hex character to a numeric value
  2328.      
  2329.      syntax:         #include "hhstring.h"
  2330.                      int ctoh(char c)
  2331.      
  2332.      description:    converts c to an integer, interpreting it as an ASCII-hex
  2333.                      character.
  2334.      
  2335.      returns:        on success: the digit derived from the input character
  2336.                      on failure: 16 (input character is not a hex digit)
  2337.      
  2338.      comments:       none
  2339.      
  2340.      keywords:       character, ASCII, hex, convert, numeric
  2341.      
  2342.      key sentence:   converts an ASCII-hex digit to its integer value
  2343.      
  2344.      see also:       btoc            dtoc            htoc
  2345.                      ctob            ctod            ctoh
  2346.      
  2347.      usage example:  compiled/executed/verified on 1/17/93
  2348.      
  2349.                      char c = 'f';
  2350.                      printf("%c  %d", c, ctoh(c));
  2351.      
  2352.                      f  15
  2353.      
  2354.                               ┌───────────────────────┐
  2355.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  2356.                               └───────────────────────┘                      */
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.  
  2374.      page  32            The Hobbit House String Library
  2375.  
  2376.  
  2377.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2378.      ║ DATESUB2.C   ║   file date: 03/13/93    page   1 of   2 ║ DATESUB2.C   ║
  2379.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2380.  
  2381.      /*                       ┌───────────────────────┐            date_without
  2382.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  2383.                               └───────────────────────┘
  2384.                                copyright(c) 1992, 1993
  2385.      
  2386.      function:       date_without (get the current date and make it into a DATE
  2387.                                    string WITOUT blanks or zeros)
  2388.      
  2389.      KWIC:           create a %date string without a pad character
  2390.      
  2391.      syntax:         #include <dos.h>
  2392.                      #include "hhstring.h"
  2393.                      char *date_without(char *date_string, char *separator)
  2394.      
  2395.      description:    date_string is filled with a string containing today's
  2396.                      date in a format which uses the specified separator but
  2397.                      has no pad characters
  2398.      
  2399.      returns:        a pointer to date_string
  2400.      
  2401.      comments:       ╔═════════════════════════════════════════════════════╗
  2402.                      ║                                                     ║
  2403.                      ║  Since there are no standards for the various data  ║
  2404.                      ║  formats handled by the HHSTRING library "strdaten" ║
  2405.                      ║  and "strdatecnv" functions, the numbering system   ║
  2406.                      ║  used is purely arbitrary. It is explained in the   ║
  2407.                      ║  file DATEINFO.DOC, which accompanies the library.  ║
  2408.                      ║                                                     ║
  2409.                      ╚═════════════════════════════════════════════════════╝
  2410.      
  2411.                      this is a support function for the functions strdate1
  2412.                      throught strdate7
  2413.      
  2414.      keywords:       date
  2415.      
  2416.      key sentence:   a support function for strdate<1->7>, this function gets
  2417.                      the current date and makes it into a DATE string without
  2418.                      any pad character (normally ' ' or '0')
  2419.      
  2420.      see also:       strdate< 1 | 2 | 3 | 4 | 5 | 6 | 7 >    strdateconv
  2421.                      date_without    make_date_without
  2422.                      date_withpad    make_date_withpad
  2423.      
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.                          The Hobbit House String Library               page  33
  2436.  
  2437.  
  2438.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2439.      ║ DATESUB2.C   ║   file date: 03/13/93    page   2 of   2 ║ DATESUB2.C   ║
  2440.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2441.  
  2442.      
  2443.      
  2444.      usage example:  compiled/executed/verified on 2/25/93
  2445.      
  2446.      
  2447.                      see the file TESTDATE.C
  2448.      
  2449.      
  2450.                               ┌───────────────────────┐
  2451.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  2452.                               └───────────────────────┘                      */
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.      page  34            The Hobbit House String Library
  2497.  
  2498.  
  2499.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2500.      ║ DATESUB1.C   ║   file date: 03/13/93    page   1 of   2 ║ DATESUB1.C   ║
  2501.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2502.  
  2503.      /*                       ┌───────────────────────┐            date_withpad
  2504.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  2505.                               └───────────────────────┘
  2506.                                copyright(c) 1992, 1993
  2507.      
  2508.      function:       date_withpad (get the current date and make it into a DATE
  2509.                                    string WITH the specified PAD character
  2510.      
  2511.      KWIC:           create a %date string with a pad character
  2512.      
  2513.      syntax:         #include <dos.h>
  2514.                      #include "hhstring.h"
  2515.                      char *date_withpad(char *date_string, char *separator,
  2516.                                         char padchar)
  2517.      
  2518.      description:    date_string is filled with a string containing todays
  2519.                      date in a format which uses the specified separator and
  2520.                      the specified pad character
  2521.      
  2522.      returns:        a pointer to date_string
  2523.      
  2524.      comments:       ╔═════════════════════════════════════════════════════╗
  2525.                      ║                                                     ║
  2526.                      ║  Since there are no standards for the various data  ║
  2527.                      ║  formats handled by the HHSTRING library "strdaten" ║
  2528.                      ║  and "strdatecnv" functions, the numbering system   ║
  2529.                      ║  used is purely arbitrary. It is explained in the   ║
  2530.                      ║  file DATEINFO.DOC, which accompanies the library.  ║
  2531.                      ║                                                     ║
  2532.                      ╚═════════════════════════════════════════════════════╝
  2533.      
  2534.                      this is a support function for the functions strdate1
  2535.                      throught strdate7
  2536.      
  2537.      keywords:       date
  2538.      
  2539.      key sentence:   a support function for strdate<1->7>, this function gets
  2540.                      the current date and makes it into a DATE string WITH a
  2541.                      specified pad character (normally ' ' or '0')
  2542.      
  2543.      see also:       strdate< 1 | 2 | 3 | 4 | 5 | 6 | 7 >    strdateconv
  2544.                      date_without    make_date_without
  2545.                      date_withpad    make_date_withpad
  2546.      
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.                          The Hobbit House String Library               page  35
  2558.  
  2559.  
  2560.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2561.      ║ DATESUB1.C   ║   file date: 03/13/93    page   2 of   2 ║ DATESUB1.C   ║
  2562.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2563.  
  2564.      
  2565.      
  2566.      usage example:  compiled/executed/verified on 2/25/93
  2567.      
  2568.      
  2569.                      see the file TESTDATE.C
  2570.      
  2571.      
  2572.                               ┌───────────────────────┐
  2573.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  2574.                               └───────────────────────┘                      */
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598.  
  2599.  
  2600.  
  2601.  
  2602.  
  2603.  
  2604.  
  2605.  
  2606.  
  2607.  
  2608.  
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614.  
  2615.  
  2616.  
  2617.  
  2618.      page  36            The Hobbit House String Library
  2619.  
  2620.  
  2621.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2622.      ║ DTOC.C       ║   file date: 03/13/93    page   1 of   1 ║ DTOC.C       ║
  2623.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2624.  
  2625.      /*                       ┌───────────────────────┐                    dtoc
  2626.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  2627.                               └───────────────────────┘
  2628.                                copyright(c) 1992, 1993
  2629.      
  2630.      function:       dtoc (Decimal digit TO ASCII Character)
  2631.      
  2632.      KWIC:           %convert an %integer to an ASCII-decimal digit
  2633.      
  2634.      syntax:         #include "hhstring.h"
  2635.                      char dtoc(int digit)
  2636.      
  2637.      description:    converts digit to the corresponding ASCII-decimal digit or
  2638.                      returns 0 if the
  2639.      
  2640.      returns:        success: the ASCII character corresponding to the
  2641.                               input digit
  2642.                      failure: 0 (the number is not in the range 0 to 9)
  2643.      
  2644.      comments:       none
  2645.      
  2646.      keywords:       character, ASCII, decimal, convert, numeric
  2647.      
  2648.      key sentence:   converts an integer in the range 0 to 9 to the
  2649.                      corresponding ASCII-decimal digit
  2650.      
  2651.      see also:       btoc            dtoc            htoc
  2652.                      ctob            ctod            ctoh
  2653.      
  2654.      usage example:  compiled/executed/verified on 1/17/93
  2655.      
  2656.                      int dig = 5;
  2657.                      printf("%d  %c", dig, dtoc(dig));
  2658.      
  2659.                      5  5
  2660.      
  2661.                               ┌───────────────────────┐
  2662.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  2663.                               └───────────────────────┘                      */
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.                          The Hobbit House String Library               page  37
  2680.  
  2681.  
  2682.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2683.      ║ FNC12.C      ║   file date: 03/13/93    page   1 of   2 ║ FNC12.C      ║
  2684.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2685.  
  2686.      /*                       ┌───────────────────────┐             fnconv_1to2
  2687.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  2688.                               └───────────────────────┘
  2689.                                copyright(c) 1992, 1993
  2690.      
  2691.      function:       fnconv_1to2 (File Name CONVersion, type 1 TO type 2)
  2692.      
  2693.      KWIC:           %converts %file name format
  2694.      
  2695.      syntax:         #include "hhstring.h"
  2696.                      void fnconv_1to2(char *fname);
  2697.      
  2698.      description:    converts fname from a type 1 format to a type 2 format.
  2699.                      The designation of "type 1" and "type 2" to these two
  2700.                      "types" is purely arbitrary and has no relationship to
  2701.                      any naming convention outside this library
  2702.      
  2703.                      file format 1 is "name.ext" with a period and no embedded
  2704.                                    spaces
  2705.                      file format 2 is "name    ext", with exactly 12 characters
  2706.                                    including however many spaces it takes in
  2707.                                    the middle to pad the name and however many
  2708.                                    it takes at the end to pad the extent
  2709.      
  2710.                      examples:
  2711.                              format 1:       "sub1.h"
  2712.                              format 2:       "sub2     h  "
  2713.      
  2714.      returns:        a pointer to the converted file name
  2715.      
  2716.      comments:       the file name must have enough space reserved to
  2717.                      accommodate the expanded name under the type 2 format.
  2718.      
  2719.                      Since the file name string is modified in the calling
  2720.                      program's space, use of this function's return value
  2721.                      is optional.
  2722.      
  2723.      keywords:       filename, convert
  2724.      
  2725.      key sentence:   converts a file name from the format containing a period
  2726.                      but no blanks to the one with exactly 12 characters and
  2727.                      no period
  2728.      
  2729.      see also:       fnconv_2to1
  2730.      
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.      page  38            The Hobbit House String Library
  2741.  
  2742.  
  2743.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2744.      ║ FNC12.C      ║   file date: 03/13/93    page   2 of   2 ║ FNC12.C      ║
  2745.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2746.  
  2747.      
  2748.      
  2749.      usage example:  compiled/executed/verified on 1/17/93
  2750.      
  2751.                      char *filename = "12345678.123";
  2752.                      printf("\n-->%s<--", filename);
  2753.                      strcpy(filename, "sub1.h");
  2754.                      fnconv_1to2(filename);
  2755.                      printf("\n-->%s<--", filename);
  2756.      
  2757.                      -->12345678.123<--
  2758.                      -->sub1     h  <--
  2759.      
  2760.                               ┌───────────────────────┐
  2761.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  2762.                               └───────────────────────┘                      */
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.                          The Hobbit House String Library               page  39
  2802.  
  2803.  
  2804.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2805.      ║ FNC21.C      ║   file date: 03/13/93    page   1 of   2 ║ FNC21.C      ║
  2806.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2807.  
  2808.      /*                       ┌───────────────────────┐             fnconv_2to1
  2809.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  2810.                               └───────────────────────┘
  2811.                                copyright(c) 1992, 1993
  2812.      
  2813.      function:       fnconv_2to1 (File Name CONVersion, type 2 TO type 1)
  2814.      
  2815.      KWIC:           %converts %file name format
  2816.      
  2817.      syntax:         #include "hhstring.h"
  2818.                      char *fnconv_2to1(char *fname);
  2819.      
  2820.      description:    converts fname from a type 2 format to a type 1 format.
  2821.                      The designation of "type 1" and "type 2" to these two
  2822.                      "types" is purely arbitrary and has no relationship to
  2823.                      any naming convention outside this library
  2824.      
  2825.                      file format 1 is "name.ext" with a period and no embedded
  2826.                                    spaces
  2827.                      file format 2 is "name    ext", with exactly 12 characters
  2828.                                    including however many spaces it takes in
  2829.                                    the middle to pad the name and however many
  2830.                                    it takes at the end to pad the extent
  2831.      
  2832.                      examples:
  2833.                              format 1:       "sub1.h"
  2834.                              format 2:       "sub2     h  "
  2835.      
  2836.      returns:        a pointer to the converted file name
  2837.      
  2838.      comments:       Since the file name string is modified in the calling
  2839.                      program's space, use of this function's return value
  2840.                      is optional.
  2841.      
  2842.      keywords:       filename, convert
  2843.      
  2844.      key sentence:   converts a file name from the format containing exactly
  2845.                      12 characters and no period to the one with no blanks
  2846.                      and a period
  2847.      
  2848.      see also:       fnconv_1to2
  2849.      
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859.  
  2860.  
  2861.  
  2862.      page  40            The Hobbit House String Library
  2863.  
  2864.  
  2865.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2866.      ║ FNC21.C      ║   file date: 03/13/93    page   2 of   2 ║ FNC21.C      ║
  2867.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2868.  
  2869.      
  2870.      
  2871.      usage example:  compiled/executed/verified on 1/17/93
  2872.      
  2873.                      char *filename = "1234     1  ";
  2874.                      printf("\n-->%s<--", filename);
  2875.                      fnconv_2to1(filename);
  2876.                      printf("\n-->%s<--", filename);
  2877.      
  2878.                      -->1234     1  <--
  2879.                      -->1234.1<--
  2880.      
  2881.                               ┌───────────────────────┐
  2882.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  2883.                               └───────────────────────┘                      */
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.  
  2914.  
  2915.  
  2916.  
  2917.  
  2918.  
  2919.  
  2920.  
  2921.  
  2922.  
  2923.                          The Hobbit House String Library               page  41
  2924.  
  2925.  
  2926.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2927.      ║ HTOC.C       ║   file date: 03/13/93    page   1 of   1 ║ HTOC.C       ║
  2928.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2929.  
  2930.      /*                       ┌───────────────────────┐                    htoc
  2931.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  2932.                               └───────────────────────┘
  2933.                                copyright(c) 1992, 1993
  2934.      
  2935.      function:       htoc (Hexadecimal digit TO ASCII Character)
  2936.      
  2937.      KWIC:           %convert a %hexadecimal digit to the corresponding ASCII
  2938.                      character.
  2939.      
  2940.      syntax:         #include "hhstring.h"
  2941.                      char htoc(int digit)
  2942.      
  2943.      description:    converts digit to its corresponding ASCII-hex digit
  2944.      
  2945.      returns:        success: the ASCII-hex character corresponding to the
  2946.                               input digit
  2947.                      failure: 0 (the input digit isn't in the range 0 to 15)
  2948.      
  2949.      comments:       none
  2950.      
  2951.      keywords:       character, ASCII, hex, convert, numeric
  2952.      
  2953.      key sentence:   converts an integer from 0 to 15 to its corresponding
  2954.                      ASCII-hex digit character
  2955.      
  2956.      see also:       btoc            dtoc            htoc
  2957.                      ctob            ctod            ctoh
  2958.      
  2959.      usage example:  compiled/executed/verified on 1/17/93
  2960.      
  2961.                      int dig = 10;
  2962.                      printf("%d  %c", dig, htoc(dig));
  2963.      
  2964.                      10  A
  2965.      
  2966.                               ┌───────────────────────┐
  2967.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  2968.                               └───────────────────────┘                      */
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981.  
  2982.  
  2983.  
  2984.      page  42            The Hobbit House String Library
  2985.  
  2986.  
  2987.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  2988.      ║ FILENAME.C   ║   file date: 03/13/93    page   1 of   2 ║ FILENAME.C   ║
  2989.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  2990.  
  2991.      /*                       ┌───────────────────────┐              isfilename
  2992.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  2993.                               └───────────────────────┘
  2994.                                copyright(c) 1992, 1993
  2995.      
  2996.      function:       isfilename (IS this a valid FILE NAME) (not a path name)
  2997.      
  2998.      KWIC:           determine the %validity of a DOS %file name (but not a
  2999.                      DOS path name)
  3000.      
  3001.      syntax:         #include <stddef.h>
  3002.                      #include "hhstring.h"
  3003.                      int isfilename(char *filename)
  3004.      
  3005.      description:    examines the filename to see whether or not it is a
  3006.                      valid DOS file name. Paths are NOT allowed. This merely
  3007.                      checks for illegal characters or too-long names or
  3008.                      extents.
  3009.      
  3010.      returns:         0 for valid file name
  3011.                      -1 if name contains * or ? but is otherwise OK
  3012.                      -2 if name contains invalid characters
  3013.                      -3 if name is too long
  3014.                      -4 if extent is too long
  3015.                      -5 if name is OK other than a meaningless
  3016.                              use of '*'
  3017.      
  3018.      comments:       none
  3019.      
  3020.      keywords:       filename
  3021.      
  3022.      key sentence:   examines a DOS file name (NOT a path name) and reports
  3023.                      on whether or not it is valid and if not, gives some
  3024.                      information about why not
  3025.      
  3026.      see also:       none
  3027.      
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044.  
  3045.                          The Hobbit House String Library               page  43
  3046.  
  3047.  
  3048.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3049.      ║ FILENAME.C   ║   file date: 03/13/93    page   2 of   2 ║ FILENAME.C   ║
  3050.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3051.  
  3052.      
  3053.      
  3054.      usage example:  compiled/executed/verified on 2/1/93
  3055.      
  3056.                      printf("\n%d", isfilename("12345678.9ab"));
  3057.                      printf("\n%d", isfilename("*.bak"));
  3058.                      printf("\n%d", isfilename("123<5>78.9ab"));
  3059.                      printf("\n%d", isfilename("123456789.ab"));
  3060.                      printf("\n%d", isfilename("1234567.89ab"));
  3061.                      printf("\n%d", isfilename("*234*.abc"));
  3062.      
  3063.                      0
  3064.                      -1
  3065.                      -2
  3066.                      -3
  3067.                      -4
  3068.                      -5
  3069.      
  3070.                               ┌───────────────────────┐
  3071.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  3072.                               └───────────────────────┘                      */
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079.  
  3080.  
  3081.  
  3082.  
  3083.  
  3084.  
  3085.  
  3086.  
  3087.  
  3088.  
  3089.  
  3090.  
  3091.  
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.      page  44            The Hobbit House String Library
  3107.  
  3108.  
  3109.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3110.      ║ DATESUB4.C   ║   file date: 03/13/93    page   1 of   2 ║ DATESUB4.C   ║
  3111.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3112.  
  3113.      /*                       ┌───────────────────────┐       make_date_without
  3114.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  3115.                               └───────────────────────┘
  3116.                                copyright(c) 1992, 1993
  3117.      
  3118.      function:       make_date_without (MAKE a DATE string WITHOUT any blanks
  3119.                                         or zeros. Put into the calling
  3120.                                         function's string.)
  3121.      
  3122.                      this is a support function for the functions strdate1
  3123.                      throught strdate7
  3124.      
  3125.      KWIC:           make a %date string without a pad character
  3126.      
  3127.      syntax:         #include <dos.h>
  3128.                      #include <stdlib.h>
  3129.                      #include "hhstring.h"
  3130.                      char *make_date_without(char *date_string, char
  3131.                                                                     *separator,
  3132.                                              struct date *DATE)
  3133.      
  3134.      
  3135.      description:    uses DATE to create date_string, using separator but no
  3136.                      blanks or 0's
  3137.      
  3138.      returns:        a pointer to date_string
  3139.      
  3140.      comments:       ╔═════════════════════════════════════════════════════╗
  3141.                      ║                                                     ║
  3142.                      ║  Since there are no standards for the various data  ║
  3143.                      ║  formats handled by the HHSTRING library "strdaten" ║
  3144.                      ║  and "strdatecnv" functions, the numbering system   ║
  3145.                      ║  used is purely arbitrary. It is explained in the   ║
  3146.                      ║  file DATEINFO.DOC, which accompanies the library.  ║
  3147.                      ║                                                     ║
  3148.                      ╚═════════════════════════════════════════════════════╝
  3149.      
  3150.      
  3151.      keywords:       date
  3152.      
  3153.      key sentence:   a support function for strdate<1->7>, this function makes
  3154.                      a date string, from the data in a data structure, without
  3155.                      any padding (blanks or zeros) and using a given seperator
  3156.                      (normally '-' or '/')
  3157.      
  3158.      see also:       strdate< 1 | 2 | 3 | 4 | 5 | 6 | 7 >    strdateconv
  3159.                      date_without    make_date_without
  3160.                      date_withpad    make_date_withpad
  3161.      
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.                          The Hobbit House String Library               page  45
  3168.  
  3169.  
  3170.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3171.      ║ DATESUB4.C   ║   file date: 03/13/93    page   2 of   2 ║ DATESUB4.C   ║
  3172.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3173.  
  3174.      
  3175.      
  3176.      usage example:  compiled/executed/verified on 2/25/93
  3177.      
  3178.      
  3179.                      see the file TESTDATE.C
  3180.      
  3181.      
  3182.                               ┌───────────────────────┐
  3183.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  3184.                               └───────────────────────┘                      */
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192.  
  3193.  
  3194.  
  3195.  
  3196.  
  3197.  
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.      page  46            The Hobbit House String Library
  3229.  
  3230.  
  3231.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3232.      ║ DATESUB3.C   ║   file date: 03/13/93    page   1 of   2 ║ DATESUB3.C   ║
  3233.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3234.  
  3235.      /*                       ┌───────────────────────┐       make_date_withpad
  3236.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  3237.                               └───────────────────────┘
  3238.                                copyright(c) 1992, 1993
  3239.      
  3240.      function:       make_date_withpad (MAKE a DATE string WITH the specified
  3241.                                         PAD (blanks or zeros) and put it into
  3242.                                         the calling function's string)
  3243.      
  3244.                      this is a support function for the functions strdate1
  3245.                      throught strdate7
  3246.      
  3247.      KWIC:           make a %date string with a pad character
  3248.      
  3249.      syntax:         #include <dos.h>
  3250.                      #include <stdlib.h>
  3251.                      #include "hhstring.h"
  3252.                      char *make_date_withpad(char *date_string, char
  3253.                                                                     *separator,
  3254.                                              struct date *DATE, char padchar)
  3255.      
  3256.      description:    uses DATE to create date_string, using the separator and
  3257.                      padchar supplied (pad is normally '/' or '-')
  3258.      
  3259.      returns:        a pointer to date_string
  3260.      
  3261.      comments:       ╔═════════════════════════════════════════════════════╗
  3262.                      ║                                                     ║
  3263.                      ║  Since there are no standards for the various data  ║
  3264.                      ║  formats handled by the HHSTRING library "strdaten" ║
  3265.                      ║  and "strdatecnv" functions, the numbering system   ║
  3266.                      ║  used is purely arbitrary. It is explained in the   ║
  3267.                      ║  file DATEINFO.DOC, which accompanies the library.  ║
  3268.                      ║                                                     ║
  3269.                      ╚═════════════════════════════════════════════════════╝
  3270.      
  3271.      
  3272.      keywords:       date
  3273.      
  3274.      key sentence:   a support function for strdate<1->7>, this function makes
  3275.                      a date string, from the data in a date structure, with a
  3276.                      specified pad character (normally ' ' or '0'), and using a
  3277.                      given seperator (normally '-' or '/')
  3278.      
  3279.      see also:       strdate< 1 | 2 | 3 | 4 | 5 | 6 | 7 >    strdateconv
  3280.                      date_without    make_date_without
  3281.                      date_withpad    make_date_withpad
  3282.      
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.                          The Hobbit House String Library               page  47
  3290.  
  3291.  
  3292.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3293.      ║ DATESUB3.C   ║   file date: 03/13/93    page   2 of   2 ║ DATESUB3.C   ║
  3294.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3295.  
  3296.      
  3297.      
  3298.      usage example:  compiled/executed/verified on 2/25/93
  3299.      
  3300.      
  3301.                      see the file TESTDATE.C
  3302.      
  3303.      
  3304.                               ┌───────────────────────┐
  3305.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  3306.                               └───────────────────────┘                      */
  3307.  
  3308.  
  3309.  
  3310.  
  3311.  
  3312.  
  3313.  
  3314.  
  3315.  
  3316.  
  3317.  
  3318.  
  3319.  
  3320.  
  3321.  
  3322.  
  3323.  
  3324.  
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.  
  3334.  
  3335.  
  3336.  
  3337.  
  3338.  
  3339.  
  3340.  
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.      page  48            The Hobbit House String Library
  3351.  
  3352.  
  3353.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3354.      ║ FIRBLK.C     ║   file date: 03/13/93    page   1 of   1 ║ FIRBLK.C     ║
  3355.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3356.  
  3357.      /*                       ┌───────────────────────┐           ptrfirstblank
  3358.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  3359.                               └───────────────────────┘
  3360.                                copyright(c) 1992, 1993
  3361.      
  3362.      function:       ptrfirstblank (get PoinTeR to FIRST BLANK)
  3363.      
  3364.      KWIC:           get the pointer to the %first %blank in a string
  3365.      
  3366.      syntax:         #include "hhstring.h"
  3367.                      char *ptrfirstblank(char *instring)
  3368.      
  3369.      description:    this function returns a pointer to the first blank in
  3370.                      instring
  3371.      
  3372.      returns:        a pointer to the first blank (NULL if EOS found before a
  3373.                      blank is found)
  3374.      
  3375.      comments:       none
  3376.      
  3377.      keywords:       pointer, first, character, blank
  3378.      
  3379.      key sentence:   gets the pointer to the first occurrence in a string of a
  3380.                      blank character
  3381.      
  3382.      see also:       ptr< first | last | next | prev >{not}blank
  3383.                      ptr< first | last | next | prev >{not}white
  3384.      
  3385.      usage example:  compiled/executed/verified on 1/31/93
  3386.      
  3387.                      char Astring[80] = "thisisthesample string";
  3388.                      char Bstring[80] = "no_blanks_in_this_string";
  3389.                      printf("\n%s", ptrfirstblank(Astring));
  3390.                      printf("\n%s", ptrfirstblank(Bstring));
  3391.      
  3392.                       string
  3393.                      (null)
  3394.      
  3395.                               ┌───────────────────────┐
  3396.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  3397.                               └───────────────────────┘                      */
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.                          The Hobbit House String Library               page  49
  3412.  
  3413.  
  3414.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3415.      ║ FIRCHR.C     ║   file date: 03/13/93    page   1 of   1 ║ FIRCHR.C     ║
  3416.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3417.  
  3418.      /*                       ┌───────────────────────┐             ptrfirstchr
  3419.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  3420.                               └───────────────────────┘
  3421.                                copyright(c) 1992, 1993
  3422.      
  3423.      function:       ptrfirstchr (get PoinTeR to FIRST occurrence of a
  3424.                                   specified CHaRacter)
  3425.      
  3426.      KWIC:           get the pointer to the %first occurrence in a string of a
  3427.                      specified %character
  3428.      
  3429.      syntax:         #include "hhstring.h"
  3430.                      char *ptrfirstchr(char *ptr)
  3431.      
  3432.      description:    this function returns a pointer to the first occurrence in
  3433.                      memory of the specified character, starting at the
  3434.                      beginning of the specified string. If the string does not
  3435.                      contain the character, the return pointer will be NULL.
  3436.      
  3437.      returns:        a pointer to the first occurrence of the character (NULL
  3438.                      if the character does not occur)
  3439.      
  3440.      comments:       none
  3441.      
  3442.      keywords:       pointer, first, character
  3443.      
  3444.      key sentence:   gets the pointer to the first occurrence in a string of a
  3445.                      specified character
  3446.      
  3447.      see also:       ptr< first | last | next | prev >{not}chr{i}
  3448.      
  3449.      usage example:  compiled/executed/verified on 1/31/93
  3450.      
  3451.                      char Astring[80] = "this is the sample string";
  3452.                      printf("\n%s", ptrfirstchr(Astring, 'm'));
  3453.                      printf("\n%s", ptrfirstchr(Astring, 'z'));
  3454.      
  3455.                      mple string
  3456.                      (null)
  3457.      
  3458.                               ┌───────────────────────┐
  3459.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  3460.                               └───────────────────────┘                      */
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.      page  50            The Hobbit House String Library
  3473.  
  3474.  
  3475.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3476.      ║ FIRCHRI.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRCHRI.C    ║
  3477.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3478.  
  3479.      /*                       ┌───────────────────────┐            ptrfirstchri
  3480.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  3481.                               └───────────────────────┘
  3482.                                copyright(c) 1992, 1993
  3483.      
  3484.      function:       ptrfirstchri (get PoinTeR to FIRST occurrence of a
  3485.                                    specified CHaRacter, Independant of case)
  3486.      
  3487.      KWIC:           get the pointer to the %first occurrence in a string of a
  3488.                      specified %character, %independent of case
  3489.      
  3490.      syntax:         #include "hhstring.h"
  3491.                      char *ptrfirstchri(char *ptr)
  3492.      
  3493.      description:    this function returns a pointer to the first occurrence in
  3494.                      memory of the specified character, independent of case,
  3495.                      starting at the beginning of the specified string. If the
  3496.                      string does not contain the character, the return pointer
  3497.                      will be NULL.
  3498.      
  3499.      returns:        a pointer to the first occurrence of the character
  3500.                      regardless of case (NULL if the character does not occur)
  3501.      
  3502.      comments:       none
  3503.      
  3504.      keywords:       pointer, first, character, case-independent
  3505.      
  3506.      key sentence:   gets the pointer to the first occurrence in a string,
  3507.                      independent of case, of a specified character
  3508.      
  3509.      see also:       ptr< first | last | next | prev >{not}chr{i}
  3510.      
  3511.      usage example:  compiled/executed/verified on 1/31/93
  3512.      
  3513.                      char Astring[80] = "this is the Sample string";
  3514.                      printf("\n%s", ptrfirstchri(Astring, 'S'));
  3515.                      printf("\n%s", ptrfirstchri(Astring, 'z'));
  3516.      
  3517.                      s is the Sample string
  3518.                      (null)
  3519.      
  3520.                               ┌───────────────────────┐
  3521.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  3522.                               └───────────────────────┘                      */
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.                          The Hobbit House String Library               page  51
  3534.  
  3535.  
  3536.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3537.      ║ FIRDIG.C     ║   file date: 03/13/93    page   1 of   1 ║ FIRDIG.C     ║
  3538.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3539.  
  3540.      /*                       ┌───────────────────────┐             ptrfirstdig
  3541.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  3542.                               └───────────────────────┘
  3543.                                copyright(c) 1992, 1993
  3544.      
  3545.      function:       ptrfirstdig (get PoinTeR to FIRst decimal DIGit)
  3546.      
  3547.      KWIC:           get the pointer to the %first %decimal digit in a string
  3548.      
  3549.      syntax:         #include "hhstring.h"
  3550.                      char *ptrfirstdig(char *ptr)
  3551.      
  3552.      description:    this function returns a pointer to the first decimal digit
  3553.                      in a string.
  3554.      
  3555.      returns:        a pointer to the first decimal digit encountered, or a
  3556.                      NULL if none are found
  3557.      
  3558.      comments:       none
  3559.      
  3560.      keywords:       pointer, first, decimal, digit
  3561.      
  3562.      key sentence:   gets the pointer to the first occurrence in a string of
  3563.                                                                             any
  3564.                      character which is a decimal digit
  3565.      
  3566.      see also:       ptr< first | last | next | prev >{not}dig
  3567.                      ptr< first | last | next | prev >{not}hex
  3568.      
  3569.      usage example:  compiled/executed/verified on 1/7/93
  3570.      
  3571.                      char Astring[80] = "123  af69 is not it ";
  3572.                      printf("\n%s", ptrfirstdig(Astring));
  3573.                      printf("\n%s", ptrfirstdig(Astring + 3));
  3574.                      printf("\n%s", ptrfirstdig(Astring + 10));
  3575.      
  3576.                      123  af69 is not it
  3577.                      69 is not it
  3578.                      (null)
  3579.      
  3580.                               ┌───────────────────────┐
  3581.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  3582.                               └───────────────────────┘                      */
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.  
  3593.  
  3594.      page  52            The Hobbit House String Library
  3595.  
  3596.  
  3597.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3598.      ║ FIRGR.C      ║   file date: 03/13/93    page   1 of   1 ║ FIRGR.C      ║
  3599.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3600.  
  3601.      /*                       ┌───────────────────────┐              ptrfirstgr
  3602.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  3603.                               └───────────────────────┘
  3604.                                copyright(c) 1992, 1993
  3605.      
  3606.      function:       ptrfirstgr (get PoinTeR to FIRST occurrence of
  3607.                                   any character in a GRoup of characters)
  3608.      
  3609.      KWIC:           get the pointer to the %first occurance of any one of a
  3610.                      %group of characters
  3611.      
  3612.      syntax:         #include "hhstring.h"
  3613.                      char *ptrfirstgr(char *instring, char *chars)
  3614.      
  3615.      description:    instring is scanned for the occurrence of any character
  3616.                      from the chars string
  3617.      
  3618.      returns:        a pointer to the character found, or a NULL if none
  3619.                      are found
  3620.      
  3621.      comments:       none
  3622.      
  3623.      keywords:       pointer, first, character, group
  3624.      
  3625.      key sentence:   gets the pointer to the first occurrence in a string of
  3626.                      any character which is in a given group of characters
  3627.      
  3628.      see also:       ptr< first | last | next | prev >{not}range
  3629.                      ptr< first | last | next | prev >{not}group
  3630.      
  3631.      usage example:  compiled/executed/verified on 2/25/93
  3632.      
  3633.                      char *Astring = "This is it: the Sample string";
  3634.                      printf("\n%s", ptrfirstgr(Astring, ".,;:!?"));
  3635.                      printf("\n%s", ptrfirstgr(Astring, "+-=()"));
  3636.      
  3637.                      : the Sample string
  3638.                      (null)
  3639.      
  3640.                               ┌───────────────────────┐
  3641.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  3642.                               └───────────────────────┘                      */
  3643.  
  3644.  
  3645.  
  3646.  
  3647.  
  3648.  
  3649.  
  3650.  
  3651.  
  3652.  
  3653.  
  3654.  
  3655.                          The Hobbit House String Library               page  53
  3656.  
  3657.  
  3658.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3659.      ║ FIRHEX.C     ║   file date: 03/13/93    page   1 of   1 ║ FIRHEX.C     ║
  3660.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3661.  
  3662.      /*                       ┌───────────────────────┐             ptrfirsthex
  3663.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  3664.                               └───────────────────────┘
  3665.                                copyright(c) 1992, 1993
  3666.      
  3667.      function:       ptrfirsthex (get PoinTeR to FIRST HEX digit in a string)
  3668.      
  3669.      KWIC:           get the pointer to the %first %hex digit in a string
  3670.      
  3671.      syntax:         #include "hhstring.h"
  3672.                      char *ptrfirsthex(char *ptr)
  3673.      
  3674.      description:    this function returns a pointer to the first hex digit
  3675.                      in memory starting at the given pointer. if the pointer
  3676.                      points at a hex digit, that will be the one pointed to
  3677.                      upon return.
  3678.      
  3679.      returns:        a pointer to the first hex digit encountered
  3680.      
  3681.      comments:       if this function is applied to a string which does not
  3682.                      contain a hex digit, it will return a pointer which is not
  3683.                      in the string, but it WILL return a pointer, assuming it
  3684.                      can find a hex digit somewhere in memory. Be careful!
  3685.      
  3686.      keywords:       pointer, first, hex, digit
  3687.      
  3688.      key sentence:   gets the pointer to the first occurrence in a string of
  3689.                      any character which is a hex digit
  3690.      
  3691.      see also:       ptr< first | last | next | prev >{not}dig
  3692.                      ptr< first | last | next | prev >{not}hex
  3693.      
  3694.      usage example:  compiled/executed/verified on 1/7/93
  3695.      
  3696.                      char Astring[80] = "123  af69 is not it";
  3697.                      printf("\n%s", ptrfirsthex(Astring +  3));
  3698.                      printf("\n%s", ptrfirsthex(Astring +  5));
  3699.                      printf("\n%s", ptrfirsthex(Astring + 10));
  3700.      
  3701.      
  3702.                      af69 is not it
  3703.                      af69 is not it
  3704.                      (null)
  3705.      
  3706.                               ┌───────────────────────┐
  3707.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  3708.                               └───────────────────────┘                      */
  3709.  
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.      page  54            The Hobbit House String Library
  3717.  
  3718.  
  3719.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3720.      ║ FIRNOBK.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRNOBK.C    ║
  3721.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3722.  
  3723.      /*                       ┌───────────────────────┐        ptrfirstnotblank
  3724.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  3725.                               └───────────────────────┘
  3726.                                copyright(c) 1992, 1993
  3727.      
  3728.      function:       ptrfirstnotblank (get PoinTeR to FIRST NOT-BLANK)
  3729.      
  3730.      KWIC:           get the pointer to the %first %non-blank in a string
  3731.      
  3732.      syntax:         #include "hhstring.h"
  3733.                      char *ptrfirstnotblank(char *ptr)
  3734.      
  3735.      description:    this function returns a pointer to the first non-blank in
  3736.                      memory starting at the beginning of the specified string.
  3737.                      If the string contains only blanks, the return pointer
  3738.                                                                            will
  3739.                      be NULL.
  3740.      
  3741.      returns:        a pointer to the first non-blank (NULL if only blanks
  3742.                      are found)
  3743.      
  3744.      comments:       note that the ASCII end of line ('\n') is NOT a blank, so
  3745.                      a string consisting of blanks ended by an EOL will NOT get
  3746.                      a NULL return from this function, it will get a pointer to
  3747.                      the EOL.
  3748.      
  3749.      keywords:       pointer, first, character, not, blank
  3750.      
  3751.      key sentence:   gets the pointer to the first character in a string which
  3752.                      is not a blank
  3753.      
  3754.      see also:       ptr< first | last | next | prev >{not}blank
  3755.                      ptr< first | last | next | prev >{not}white
  3756.      
  3757.      usage example:  compiled/executed/verified on 12/21/92
  3758.      
  3759.                      char Astring[80] = "      this is the sample string";
  3760.                      printf("%s", ptrfirstnotblank(Astring));
  3761.      
  3762.                      this the sample string
  3763.      
  3764.                               ┌───────────────────────┐
  3765.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  3766.                               └───────────────────────┘                      */
  3767.  
  3768.  
  3769.  
  3770.  
  3771.  
  3772.  
  3773.  
  3774.  
  3775.  
  3776.  
  3777.                          The Hobbit House String Library               page  55
  3778.  
  3779.  
  3780.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3781.      ║ FIRNOCH.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRNOCH.C    ║
  3782.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3783.  
  3784.      /*                       ┌───────────────────────┐          ptrfirstnotchr
  3785.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  3786.                               └───────────────────────┘
  3787.                                copyright(c) 1992, 1993
  3788.      
  3789.      function:       ptrfirstnotchr (get PoinTeR to FIRST character which is
  3790.                                      NOT the specified CHaRacter)
  3791.      
  3792.      KWIC:           get the pointer to the %first occurrence of a character
  3793.                      which is not the specified %character
  3794.      
  3795.      syntax:         #include "hhstring.h"
  3796.                      char *ptrfirstnotchr(char *ptr, char *find)
  3797.      
  3798.      description:    this function returns a pointer to the first character
  3799.                      which is not find.
  3800.      
  3801.      returns:        a pointer to the first non-find (NULL if only find is
  3802.                      found)
  3803.      
  3804.      comments:       none
  3805.      
  3806.      keywords:       pointer, first, character, not
  3807.      
  3808.      key sentence:   gets the pointer to the first occurrence in a string of
  3809.                      any character other than a specified character
  3810.      
  3811.      see also:       ptr< first | last | next | prev >{not}chr{i}
  3812.      
  3813.      usage example:  compiled/executed/verified on 12/21/92
  3814.      
  3815.                      char *Astring = "aaaaaaaaThis is the Sample string";
  3816.                      printf("%s", ptrfirstnotchr(Astring, 'a'));
  3817.      
  3818.                      This is the Sample string
  3819.      
  3820.                               ┌───────────────────────┐
  3821.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  3822.                               └───────────────────────┘                      */
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.      page  56            The Hobbit House String Library
  3839.  
  3840.  
  3841.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3842.      ║ FIRNOCI.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRNOCI.C    ║
  3843.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3844.  
  3845.      /*                       ┌───────────────────────┐         ptrfirstnotchri
  3846.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  3847.                               └───────────────────────┘
  3848.                                copyright(c) 1992, 1993
  3849.      
  3850.      function:       ptrfirstnotchri (get PoinTeR to FIRST character which is
  3851.                                       NOT the specified CHaRacter, Independant
  3852.                                       of case)
  3853.      
  3854.      KWIC:           get the pointer to the %first occurrence of a character
  3855.                      which is not the specified %character, %independent of
  3856.                                                                            case
  3857.      
  3858.      syntax:         #include "hhstring.h"
  3859.                      char *ptrfirstnotchri(char *ptr, char *find)
  3860.      
  3861.      description:    this function returns a pointer to the first character
  3862.                      which is not find in uppercase and not find in lowercase.
  3863.      
  3864.      returns:        a pointer to the first non-find (NULL if only find is
  3865.                      found)
  3866.      
  3867.      comments:       none
  3868.      
  3869.      keywords:       pointer, first, character, not, case-independent
  3870.      
  3871.      key sentence:   gets the pointer to the first occurrence in a string of
  3872.                      any character which, independent of case, is not a
  3873.                      specified character
  3874.      
  3875.      see also:       ptr< first | last | next | prev >{not}chr{i}
  3876.      
  3877.      usage example:  compiled/executed/verified on 12/21/92
  3878.      
  3879.                      char *Astring = "aaaAaaAaaThis is the Sample string";
  3880.                      printf("%s", ptrfirstnotchri(Astring, 'A'));
  3881.      
  3882.                      This is the Sample string
  3883.      
  3884.                               ┌───────────────────────┐
  3885.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  3886.                               └───────────────────────┘                      */
  3887.  
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.                          The Hobbit House String Library               page  57
  3900.  
  3901.  
  3902.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3903.      ║ FIRNODG.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRNODG.C    ║
  3904.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3905.  
  3906.      /*                       ┌───────────────────────┐          ptrfirstnotdig
  3907.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  3908.                               └───────────────────────┘
  3909.                                copyright(c) 1992, 1993
  3910.      
  3911.      function:       ptrfirstnotdig (get PoinTeR to FIRST character which is
  3912.                                      NOT a decimal DIGit)
  3913.      
  3914.      KWIC:           get the pointer to the %first %non-digit in a string
  3915.      
  3916.      syntax:         #include "hhstring.h"
  3917.                      char *ptrfirstnotdig(char *ptr)
  3918.      
  3919.      description:    this function returns a pointer to the first non-digit in
  3920.                      memory starting at the beginning of the specified string.
  3921.                      If the string contains only digits, the return pointer
  3922.                                                                            will
  3923.                      be NULL.
  3924.      
  3925.      returns:        a pointer to the first non-digit (NULL if only digits
  3926.                      are found)
  3927.      
  3928.      comments:       none
  3929.      
  3930.      keywords:       pointer, first, character, not, decimal, digit
  3931.      
  3932.      key sentence:   gets the pointer to the first occurrence in a string of
  3933.                      any character which is not a decimal digit
  3934.      
  3935.      see also:       ptr< first | last | next | prev >{not}dig
  3936.                      ptr< first | last | next | prev >{not}hex
  3937.      
  3938.      usage example:  compiled/executed/verified on 1/31/93
  3939.      
  3940.                      char Astring[80] = "123,456.78";
  3941.                      char Bstring[80] = "123456789";
  3942.                      printf("\n%s", ptrfirstnotdig(Astring));
  3943.                      printf("\n%s", ptrfirstnotdig(Bstring));
  3944.      
  3945.                      ,456.78
  3946.                      (null)
  3947.      
  3948.                               ┌───────────────────────┐
  3949.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  3950.                               └───────────────────────┘                      */
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.      page  58            The Hobbit House String Library
  3961.  
  3962.  
  3963.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  3964.      ║ FIRNOGR.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRNOGR.C    ║
  3965.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  3966.  
  3967.      /*                       ┌───────────────────────┐           ptrfirstnotgr
  3968.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  3969.                               └───────────────────────┘
  3970.                                copyright(c) 1992, 1993
  3971.      
  3972.      function:       ptrfirstnotgr (get PoinTeR to FIRST occurrence of a
  3973.                                      character which is NOT in a GRoup of
  3974.                                      characters)
  3975.      
  3976.      KWIC:           get the pointer to the %first occurrence of any character
  3977.                      which is not in a %group of characters
  3978.      
  3979.      syntax:         #include "hhstring.h"
  3980.                      char *ptrfirstnotgr(char *instring, char *chars)
  3981.      
  3982.      description:    returns a pointer to the first occurrence in instring of
  3983.                      any character in chars
  3984.      
  3985.      returns:        a pointer to the first character not in the group, or a
  3986.                      NULL if the string contains only characters in the group
  3987.      
  3988.      comments:       none
  3989.      
  3990.      keywords:       pointer, first, not, character, group
  3991.      
  3992.      key sentence:   gets the pointer to the first occurrence in a string of
  3993.                      any character which is not in a given group of characters
  3994.      
  3995.      see also:       ptr< first | last | next | prev >{not}range
  3996.                      ptr< first | last | next | prev >{not}group
  3997.      
  3998.      usage example:  compiled/executed/verified on 2/25/93
  3999.      
  4000.                      char *Astring = "...!..This is the Sample string";
  4001.                      printf("\n%s", ptrfirstnotgr(Astring, ".,;:!?"));
  4002.      
  4003.                      This is the Sample string
  4004.      
  4005.                               ┌───────────────────────┐
  4006.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4007.                               └───────────────────────┘                      */
  4008.  
  4009.  
  4010.  
  4011.  
  4012.  
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.  
  4019.  
  4020.  
  4021.                          The Hobbit House String Library               page  59
  4022.  
  4023.  
  4024.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4025.      ║ FIRNOHX.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRNOHX.C    ║
  4026.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4027.  
  4028.      /*                       ┌───────────────────────┐          ptrfirstnothex
  4029.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4030.                               └───────────────────────┘
  4031.                                copyright(c) 1992, 1993
  4032.      
  4033.      function:       ptrfirstnothex (get PoinTeR to FIRST character which is
  4034.                                      NOT a HEX digit)
  4035.      
  4036.      KWIC:           get the pointer to the %first %non-hexdigit in a string
  4037.      
  4038.      syntax:         #include "hhstring.h"
  4039.                      char *ptrfirstnothex(char *ptr)
  4040.      
  4041.      description:    this function returns a pointer to the first non-hexdigit
  4042.                      in memory starting at the beginning of the specified
  4043.                                                                         string.
  4044.      
  4045.      returns:        a pointer to the first non-hexdigit (NULL if only hex
  4046.                      digits are found)
  4047.      
  4048.      comments:       none
  4049.      
  4050.      keywords:       pointer, first, character, not, hex, digit
  4051.      
  4052.      key sentence:   gets the pointer to the first occurrence in a string of
  4053.                      any character which is not a hex digit
  4054.      
  4055.      see also:       ptr< first | last | next | prev >{not}dig
  4056.                      ptr< first | last | next | prev >{not}hex
  4057.      
  4058.      usage example:  compiled/executed/verified on 12/21/92
  4059.      
  4060.                      char *Astring = "07af:c1be";
  4061.                      printf("%s", ptrfirstnothex(Astring));
  4062.      
  4063.                      :c1be
  4064.      
  4065.                               ┌───────────────────────┐
  4066.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4067.                               └───────────────────────┘                      */
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.      page  60            The Hobbit House String Library
  4083.  
  4084.  
  4085.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4086.      ║ FIRNORN.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRNORN.C    ║
  4087.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4088.  
  4089.      /*                       ┌───────────────────────┐        ptrfirstnotrange
  4090.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4091.                               └───────────────────────┘
  4092.                                copyright(c) 1992, 1993
  4093.      
  4094.      function:       ptrfirstnotrange (get PoinTeR to FIRST occurrence of any
  4095.                                      character NOT in a RANGE of characters)
  4096.      
  4097.      KWIC:           gets the pointer to the %first occurrence of any character
  4098.                      not in a %range of characters
  4099.      
  4100.      syntax:         #include "hhstring.h"
  4101.                      char *ptrfirstnotrange(char *instring, char c1, char c2)
  4102.      
  4103.      description:    returns a pointer to the first occurrence in instring of
  4104.                      a character not in the range c1 to c2 inclusive
  4105.      
  4106.      returns:        a pointer to the first character not in the range, or a
  4107.                      NULL if the whole string is in the range
  4108.      
  4109.      comments:       none
  4110.      
  4111.      keywords:       pointer, first, character, not, range
  4112.      
  4113.      key sentence:   gets the pointer to the first occurrence in a string of
  4114.                      any character which is not in a given range of characters
  4115.      
  4116.      see also:       ptr< first | last | next | prev >{not}range
  4117.                      ptr< first | last | next | prev >{not}set
  4118.      
  4119.      usage example:  compiled/executed/verified on 2/25/93
  4120.      
  4121.                      char *Astring = "This_is_it:_the_Sample_string";
  4122.                      printf("\n%s", ptrfirstnotrange(Astring, 'A', 'z'));
  4123.                      printf("\n%s", ptrfirstnotrange(Astring, '!', 'z'));
  4124.      
  4125.                      :_the_Sample_string
  4126.                      (null)
  4127.      
  4128.                               ┌───────────────────────┐
  4129.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4130.                               └───────────────────────┘                      */
  4131.  
  4132.  
  4133.  
  4134.  
  4135.  
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.                          The Hobbit House String Library               page  61
  4144.  
  4145.  
  4146.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4147.      ║ FIRNOTT.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRNOTT.C    ║
  4148.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4149.  
  4150.      /*                       ┌───────────────────────┐     ptrfirstnottextterm
  4151.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4152.                               └───────────────────────┘
  4153.                                copyright(c) 1992, 1993
  4154.      
  4155.      function:       ptrfirstnottextterm (get PoinTeR to FIRST NOT-TEXT-
  4156.                                           TERMinator)
  4157.      
  4158.      KWIC:           get the pointer to the %first %non-text-terminator in a
  4159.                      string
  4160.      
  4161.      syntax:         #include "hhstring.h"
  4162.                      char *ptrfirstnottextterm(char *ptr)
  4163.      
  4164.      description:    this function returns a pointer to the first non-text-
  4165.                      terminator in memory starting at the beginning of the
  4166.                      specified string.
  4167.      
  4168.      returns:        a pointer to the first non-text-terminator or NULL if only
  4169.                      text terminators are found in the string.
  4170.      
  4171.      comments:       a "text word" is a human language construct as opposed to
  4172.                      a "string word" which is simply a set of characters
  4173.                      surrounded by whitespace. The only distinction made by
  4174.                      this function library is in the terminator. "Words" are
  4175.                      terminated by a blank, a tab, an ASCII End-Of-Line (EOL)
  4176.                      or an End-Of-String (EOS). "Text words", however, may also
  4177.                      be terminated by any of these punctuation marks: .!?:;,
  4178.      
  4179.      keywords:       pointer, first, character, not, text, terminator
  4180.      
  4181.      key sentence:   gets the pointer to the first character in a string which
  4182.                      is not a text terminator
  4183.      
  4184.      see also:       ptr< first | last | next | prev >nottextterm
  4185.      
  4186.      usage example:  compiled/executed/verified on 1/31/93
  4187.      
  4188.                      char Astring[80] = "  ? !    this is the sample string";
  4189.                      char Bstring[80] = "  ? !  .  ";
  4190.                      printf("\n%s", ptrfirstnottextterm(Astring));
  4191.                      printf("\n%s", ptrfirstnottextterm(Bstring));
  4192.      
  4193.                      this the sample string
  4194.                      (null)
  4195.      
  4196.                               ┌───────────────────────┐
  4197.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4198.                               └───────────────────────┘                      */
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.      page  62            The Hobbit House String Library
  4205.  
  4206.  
  4207.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4208.      ║ FIRNOWH.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRNOWH.C    ║
  4209.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4210.  
  4211.      /*                       ┌───────────────────────┐        ptrfirstnotwhite
  4212.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4213.                               └───────────────────────┘
  4214.                                copyright(c) 1992, 1993
  4215.      
  4216.      function:       ptrfirstnotwhite (get PoinTeR to FIRST NOT-WHITE)
  4217.      
  4218.      KWIC:           get the pointer to the %first %non-whitespace in a string
  4219.      
  4220.      syntax:         #include "hhstring.h"
  4221.                      char *ptrfirstnotwhite(char *ptr)
  4222.      
  4223.      description:    this function returns a pointer to the first non-white
  4224.                      character in memory starting at the beginning of the
  4225.                      specified string. If the string contains only whitespace,
  4226.                      the return pointer will be NULL.
  4227.      
  4228.      returns:        a pointer to the first non-whitespace character (NULL if
  4229.                      only whitespace is found)
  4230.      
  4231.      comments:       note that the ASCII end of line ('\n') is NOT white, so
  4232.                      a string consisting of nothing but an EOL will NOT get a
  4233.                      NULL return from this function, it will get a pointer to
  4234.                      the EOL.
  4235.      
  4236.      keywords:       pointer, first, character, not, whitespace, blank, tab
  4237.      
  4238.      key sentence:   gets the pointer to the first occurrence in a string of
  4239.                      any character which is not whitespace
  4240.      
  4241.      see also:       ptr< first | last | next | prev >{not}blank
  4242.                      ptr< first | last | next | prev >{not}white
  4243.      
  4244.      usage example:  compiled/executed/verified on 2/19/93
  4245.      
  4246.                      char Astring[80] = "\t\t   this is the sample string";
  4247.                      printf("\n%s", ptrfirstnotwhite(Astring));
  4248.                      printf("\n%s", ptrfirstnotwhite("   \t   "));
  4249.      
  4250.                      this the sample string
  4251.                      (null)
  4252.      
  4253.                               ┌───────────────────────┐
  4254.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4255.                               └───────────────────────┘                      */
  4256.  
  4257.  
  4258.  
  4259.  
  4260.  
  4261.  
  4262.  
  4263.  
  4264.  
  4265.                          The Hobbit House String Library               page  63
  4266.  
  4267.  
  4268.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4269.      ║ FIRNOWT.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRNOWT.C    ║
  4270.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4271.  
  4272.      /*                       ┌───────────────────────┐     ptrfirstnotwordterm
  4273.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4274.                               └───────────────────────┘
  4275.                                copyright(c) 1992, 1993
  4276.      
  4277.      function:       ptrfirstnotwordterm (get PoinTeR to FIRST NOT-WORD-
  4278.                                           TERMinator)
  4279.      
  4280.      KWIC:           get the pointer to the %first %non-word-terminator in a
  4281.                      string
  4282.      
  4283.      syntax:         #include "hhstring.h"
  4284.                      char *ptrfirstnotwordterm(char *ptr)
  4285.      
  4286.      description:    this function returns a pointer to the first non-word-
  4287.                      terminator in memory starting at the beginning of the
  4288.                      specified string.
  4289.      
  4290.      returns:        a pointer to the first non-word-terminator or NULL if only
  4291.                      word terminators are found in the string.
  4292.      
  4293.      comments:       none
  4294.      
  4295.      keywords:       pointer, first, character, not, word, terminator
  4296.      
  4297.      key sentence:   gets the pointer to the first character in a string which
  4298.                      is not a word terminator
  4299.      
  4300.      see also:       ptr< first | last | next | prev >notwordterm
  4301.      
  4302.      usage example:  compiled/executed/verified on 1/31/93
  4303.      
  4304.                      char Astring[80] = "       this is the sample string";
  4305.                      char Bstring[80] = "       ";
  4306.                      printf("\n%s", ptrfirstnotwordterm(Astring));
  4307.                      printf("\n%s", ptrfirstnotwordterm(Bstring));
  4308.      
  4309.                      this the sample string
  4310.                      (null)
  4311.      
  4312.                               ┌───────────────────────┐
  4313.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4314.                               └───────────────────────┘                      */
  4315.  
  4316.  
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.  
  4326.      page  64            The Hobbit House String Library
  4327.  
  4328.  
  4329.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4330.      ║ FIRRAN.C     ║   file date: 03/13/93    page   1 of   1 ║ FIRRAN.C     ║
  4331.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4332.  
  4333.      /*                       ┌───────────────────────┐           ptrfirstrange
  4334.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4335.                               └───────────────────────┘
  4336.                                copyright(c) 1992, 1993
  4337.      
  4338.      function:       ptrfirstrange (get PoinTeR to FIRST occurrence of any
  4339.                                   character in a RANGE of characters)
  4340.      
  4341.      KWIC:           get the pointer to the %first occurance of any character
  4342.                      from a %range of characters
  4343.      
  4344.      syntax:         #include "hhstring.h"
  4345.                      char *ptrfirstrange(char *instring, char c1, char c2)
  4346.      
  4347.      description:    instring is scanned for the occurrence of any character
  4348.                      contained in the range c1 to c2 inclusive
  4349.      
  4350.      returns:        a pointer to the character found, or a NULL if none
  4351.                      are found
  4352.      
  4353.      comments:       none
  4354.      
  4355.      keywords:       pointer, first, character, range
  4356.      
  4357.      key sentence:   gets the pointer to the first occurrence in a string of
  4358.                      any character which is in a given range of characters
  4359.      
  4360.      see also:       ptr< first | last | next | prev >{not}range
  4361.                      ptr< first | last | next | prev >{not}set
  4362.      
  4363.      usage example:  compiled/executed/verified on 2/25/93
  4364.      
  4365.                      char *Astring = "This is it: the Sample string";
  4366.                      printf("\n%s", ptrfirstrange(Astring, '!', '?'));
  4367.                      printf("\n%s", ptrfirstrange(Astring, '!', '/'));
  4368.      
  4369.                      : the Sample string
  4370.                      (null)
  4371.      
  4372.                               ┌───────────────────────┐
  4373.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4374.                               └───────────────────────┘                      */
  4375.  
  4376.  
  4377.  
  4378.  
  4379.  
  4380.  
  4381.  
  4382.  
  4383.  
  4384.  
  4385.  
  4386.  
  4387.                          The Hobbit House String Library               page  65
  4388.  
  4389.  
  4390.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4391.      ║ FIRSUB.C     ║   file date: 03/13/93    page   1 of   1 ║ FIRSUB.C     ║
  4392.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4393.  
  4394.      /*                       ┌───────────────────────┐             ptrfirstsub
  4395.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4396.                               └───────────────────────┘
  4397.                                copyright(c) 1992, 1993
  4398.      
  4399.      function:       ptrfirstsub (get PoinTeR to FIRST occurrence of a
  4400.                                   SUBstring)
  4401.      
  4402.      KWIC:           get the pointer to the %first occurrence of a %substring
  4403.                                                                              in
  4404.                      a string
  4405.      
  4406.      syntax:         #include "hhstring.h"
  4407.                      char *ptrfirstsub(char *instring, char *substring)
  4408.      
  4409.      description:    instring is scanned for the first occurrence of substring
  4410.      
  4411.      returns:        a pointer to the substring, or NULL if substring not found
  4412.      
  4413.      comments:       included to have consistent name in the string lib; this
  4414.                      is a macro, defined in hhstring.h using the ANSI function
  4415.                      strstr, as follows:
  4416.      
  4417.                      #define ptrfirstsub(a, b)       strstr(a, b)
  4418.      
  4419.      keywords:       pointer, first, substring
  4420.      
  4421.      key sentence:   gets the pointer to the first occurrence in a string of
  4422.                      a given substring
  4423.      
  4424.      see also:       ptr< first | last | next | prev >sub{i}
  4425.      
  4426.      usage example:  compiled/executed/verified on 12/16/92
  4427.      
  4428.                      char *Astring = "This is the Sample string";
  4429.                      printf("%s", ptrfirstsub(Astring, "Sample"));
  4430.      
  4431.                      Sample string
  4432.      
  4433.                               ┌───────────────────────┐
  4434.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4435.                               └───────────────────────┘                      */
  4436.  
  4437.  
  4438.  
  4439.  
  4440.  
  4441.  
  4442.  
  4443.  
  4444.  
  4445.  
  4446.  
  4447.  
  4448.      page  66            The Hobbit House String Library
  4449.  
  4450.  
  4451.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4452.      ║ FIRSUBI.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRSUBI.C    ║
  4453.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4454.  
  4455.      /*                       ┌───────────────────────┐            ptrfirstsubi
  4456.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4457.                               └───────────────────────┘
  4458.                                copyright(c) 1992, 1993
  4459.      
  4460.      function:       ptrfirstsubi (get PoinTeR to FIRST occurrence of
  4461.                                    a SUBstring, Independant of case)
  4462.      
  4463.      KWIC:           gets the pointer to the %first occurrence of a %substring
  4464.                      in a string
  4465.      
  4466.      syntax:         #include "hhstring.h"
  4467.                      char *ptrfirstsubi(char *instring, char *substring)
  4468.      
  4469.      description:    returns a pointer to the first occurrence of substring in
  4470.                      instring
  4471.      
  4472.      returns:        a pointer to the substring, or a NULL if the substring is
  4473.                      not present
  4474.      
  4475.      comments:       none
  4476.      
  4477.      keywords:       pointer, first, substring, case-independent
  4478.      
  4479.      key sentence:   gets the pointer to the first occurrence in a string,
  4480.                      independent of case, of a given substring
  4481.      
  4482.      see also:       ptr< first | last | next | prev >sub{i}
  4483.      
  4484.      usage example:  compiled/executed/verified on 2/25/93
  4485.      
  4486.                      char *Astring = "This is the Sample string";
  4487.                      printf("\n%s", ptrfirstsubi(Astring, "SAMPLE string"));
  4488.                      printf("\n%s", ptrfirstsubi(Astring, "notpresent"));
  4489.      
  4490.                      Sample string
  4491.                      (null)
  4492.      
  4493.                               ┌───────────────────────┐
  4494.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4495.                               └───────────────────────┘                      */
  4496.  
  4497.  
  4498.  
  4499.  
  4500.  
  4501.  
  4502.  
  4503.  
  4504.  
  4505.  
  4506.  
  4507.  
  4508.  
  4509.                          The Hobbit House String Library               page  67
  4510.  
  4511.  
  4512.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4513.      ║ FIRTEXT.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRTEXT.C    ║
  4514.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4515.  
  4516.      /*                       ┌───────────────────────┐            ptrfirsttext
  4517.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4518.                               └───────────────────────┘
  4519.                                copyright(c) 1992, 1993
  4520.      
  4521.      function:       ptrfirsttext (get PoinTeR to FIRST TEXT word)
  4522.      
  4523.      KWIC:           get the pointer to the %first %text word in a string
  4524.      
  4525.      syntax:         #include "hhstring.h"
  4526.                      char *ptrfirsttext(char *ptr)
  4527.      
  4528.      description:    this function returns a pointer to the first text word
  4529.                      in memory starting at the beginning of the specified
  4530.                      string. If the string contains only whitespace, the
  4531.                      return pointer will be NULL.
  4532.      
  4533.      returns:        a pointer to the first text word (NULL if only whitespace
  4534.                      and punctuation is found)
  4535.      
  4536.      comments:       none
  4537.      
  4538.      keywords:       pointer, first, text, word
  4539.      
  4540.      key sentence:   gets the pointer to the first text word in a string
  4541.      
  4542.      see also:       ptr< first | last | next | this | prev>text
  4543.      
  4544.      usage example:  compiled/executed/verified on 1/30/93
  4545.      
  4546.                      char Astring[80] = "\t\t   not. It is";
  4547.                      char Bstring[80] = "first! word comes first";
  4548.                      char Cstring[80] = "\n . \t  ?  \n";
  4549.                      printf("\n%s", ptrfirsttext(Astring));
  4550.                      printf("\n%s", ptrfirsttext(Bstring));
  4551.                      printf("\n%s", ptrfirsttext(Cstring));
  4552.      
  4553.                      not. It is
  4554.                      first! word comes first
  4555.                      (null)
  4556.      
  4557.                               ┌───────────────────────┐
  4558.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4559.                               └───────────────────────┘                      */
  4560.  
  4561.  
  4562.  
  4563.  
  4564.  
  4565.  
  4566.  
  4567.  
  4568.  
  4569.  
  4570.      page  68            The Hobbit House String Library
  4571.  
  4572.  
  4573.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4574.      ║ FIRTXTR.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRTXTR.C    ║
  4575.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4576.  
  4577.      /*                       ┌───────────────────────┐        ptrfirsttextterm
  4578.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4579.                               └───────────────────────┘
  4580.                                copyright(c) 1992, 1993
  4581.      
  4582.      function:       ptrfirsttextterm (get PoinTeR to FIRST TEXT word
  4583.                                        TERMinator)
  4584.      
  4585.      KWIC:           get the pointer to the %first %text word terminator in a
  4586.                      string
  4587.      
  4588.      syntax:         #include "hhstring.h"
  4589.                      char *ptrfirsttextterm(char *substring)
  4590.      
  4591.      description:    this function returns a pointer to the first text word
  4592.                      terminator in instring.
  4593.      
  4594.      returns:        a pointer to the first text word terminator character
  4595.                      (NULL if no text word terminator is found)
  4596.      
  4597.      comments:       a "text word" is a human language construct as opposed to
  4598.                      a "string word" which is simply a set of characters
  4599.                      surrounded by whitespace. The only distinction made by
  4600.                      this function library is in the terminator. "Words" are
  4601.                      terminated by a blank, a tab, an ASCII End-Of-Line (EOL)
  4602.                      or an End-Of-String (EOS). "Text words", however, may also
  4603.                      be terminated by any of these punctuation marks: .!?:;,
  4604.      
  4605.      keywords:       pointer, first, character, text, terminator
  4606.      
  4607.      key sentence:   gets the pointer to the first occurrence in a string of
  4608.                      any character which is a text word terminator. I.E. one
  4609.                      of the characters in " \t\n\0.!?:;,
  4610.      
  4611.      see also:       ptr< first | last | next | prev >textterm
  4612.      
  4613.      usage example:  compiled/executed/verified on 2/10/93
  4614.      
  4615.                      char Astring[80] = "thisisthe.sample string";
  4616.                      char Bstring[80] = "and\tso is this";
  4617.                      printf("\n%s", ptrfirsttextterm(Astring));
  4618.                      printf("\n%s", ptrfirsttextterm(Bstring));
  4619.                      printf("\n%s", ptrfirsttextterm("nonehere"));
  4620.      
  4621.                      .sample string
  4622.                              so is this              leading blanks are the tab
  4623.                      (null)
  4624.      
  4625.                               ┌───────────────────────┐
  4626.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4627.                               └───────────────────────┘                      */
  4628.  
  4629.  
  4630.  
  4631.                          The Hobbit House String Library               page  69
  4632.  
  4633.  
  4634.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4635.      ║ FIRWH.C      ║   file date: 03/13/93    page   1 of   1 ║ FIRWH.C      ║
  4636.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4637.  
  4638.      /*                       ┌───────────────────────┐           ptrfirstwhite
  4639.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4640.                               └───────────────────────┘
  4641.                                copyright(c) 1992, 1993
  4642.      
  4643.      function:       ptrfirstwhite (get PoinTeR to FIRST WHITEspace)
  4644.      
  4645.      KWIC:           get the pointer to the %first %whitespace in a string
  4646.      
  4647.      syntax:         #include "hhstring.h"
  4648.                      char *ptrfirstwhite(char *substring)
  4649.      
  4650.      description:    this function returns a pointer to the first blank or tab
  4651.                      in instring
  4652.      
  4653.      returns:        a pointer to the first whitespace character (NULL if no
  4654.                      whitespace is found)
  4655.      
  4656.      comments:       none
  4657.      
  4658.      keywords:       pointer, first, character, whitespace, blank, tab
  4659.      
  4660.      key sentence:   gets the pointer to the first occurrence in a string of
  4661.                      any character which is whitespace (a blank or a tab)
  4662.      
  4663.      see also:       ptr< first | last | next | prev >{not}blank
  4664.                      ptr< first | last | next | prev >{not}white
  4665.      
  4666.      usage example:  compiled/executed/verified on 1/7/93
  4667.      
  4668.                      char Astring[80] = "thisisthesample string";
  4669.                      char Bstring[80] = "and\tso is this";
  4670.                      printf("\n%s", ptrfirstwhite(Astring));
  4671.                      printf("\n%s", ptrfirstwhite(Bstring));
  4672.      
  4673.                       string
  4674.                              so is this              leading blanks are the tab
  4675.      
  4676.                               ┌───────────────────────┐
  4677.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4678.                               └───────────────────────┘                      */
  4679.  
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.      page  70            The Hobbit House String Library
  4693.  
  4694.  
  4695.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4696.      ║ FIRWORD.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRWORD.C    ║
  4697.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4698.  
  4699.      /*                       ┌───────────────────────┐            ptrfirstword
  4700.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4701.                               └───────────────────────┘
  4702.                                copyright(c) 1992, 1993
  4703.      
  4704.      function:       ptrfirstword (get PoinTeR to FIRST WORD)
  4705.      
  4706.      KWIC:           get the pointer to the %first %word in a string
  4707.      
  4708.      syntax:         #include "hhstring.h"
  4709.                      char *ptrfirstword(char *ptr)
  4710.      
  4711.      description:    this function returns a pointer to the first word
  4712.                      in memory starting at the beginning of the specified
  4713.                      string. If the string contains only whitespace, the
  4714.                      return pointer will be NULL.
  4715.      
  4716.      returns:        a pointer to the first word (NULL if only whitespace
  4717.                      is found)
  4718.      
  4719.      comments:       none
  4720.      
  4721.      keywords:       pointer, first, word
  4722.      
  4723.      key sentence:   gets the pointer to the first word in a string
  4724.      
  4725.      see also:       ptr< first | last | next | this | prev>word
  4726.      
  4727.      usage example:  compiled/executed/verified on 12/26/92
  4728.      
  4729.                      char Astring[80] = "\t\t   this is the sample string";
  4730.                      char Bstring[80] = "first word comes first";
  4731.                      char Cstring[80] = "\n   \t    \n";
  4732.                      printf("\n%s", ptrfirstword(Astring));
  4733.                      printf("\n%s", ptrfirstword(Bstring));
  4734.                      printf("\n%s", ptrfirstword(Cstring));
  4735.      
  4736.                      this is the sample string
  4737.                      first word comes first
  4738.                      (null)
  4739.      
  4740.                               ┌───────────────────────┐
  4741.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4742.                               └───────────────────────┘                      */
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.                          The Hobbit House String Library               page  71
  4754.  
  4755.  
  4756.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4757.      ║ FIRWDTR.C    ║   file date: 03/13/93    page   1 of   1 ║ FIRWDTR.C    ║
  4758.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4759.  
  4760.      /*                       ┌───────────────────────┐       ptrfirstwordterm
  4761.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4762.                               └───────────────────────┘
  4763.                                copyright(c) 1992, 1993
  4764.      
  4765.      function:       ptrfirstwordterm (get PoinTeR to FIRST WORD TERMinator)
  4766.      
  4767.      KWIC:           get the pointer to the %first %word terminator in a string
  4768.      
  4769.      syntax:         #include "hhstring.h"
  4770.                      char *ptrfirstwordterm(char *substring)
  4771.      
  4772.      description:    this function returns a pointer to the first word
  4773.                      terminator in instring.
  4774.      
  4775.      returns:        a pointer to the first word terminator character (NULL if
  4776.                      no word terminator is found)
  4777.      
  4778.      comments:       Note that word terminator is a member of the set ' ',
  4779.                      '\t', '\n', '\0'. It is NOT an English language
  4780.                      terminator. For those, see the functions using the
  4781.                      term text instead of the term word.
  4782.      
  4783.      keywords:       pointer, first, word, terminator
  4784.      
  4785.      key sentence:   gets the pointer to the first occurrence in a string of
  4786.                      any character which is a word (NOT a "text" word)
  4787.                      terminator. I.E. one of the characters in " \t\n\0"
  4788.      
  4789.      see also:       ptr< first | last | next | prev >{not}blank
  4790.                      ptr< first | last | next | prev >{not}white
  4791.      
  4792.      usage example:  compiled/executed/verified on 1/15/93
  4793.      
  4794.                      char Astring[80] = "thisisthesample string";
  4795.                      char Bstring[80] = "and\tso is this";
  4796.                      printf("\n%s", ptrfirstwordterm(Astring));
  4797.                      printf("\n%s", ptrfirstwordterm(Bstring));
  4798.      
  4799.                       string
  4800.                              so is this              leading blanks are the tab
  4801.      
  4802.                               ┌───────────────────────┐
  4803.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4804.                               └───────────────────────┘                      */
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.      page  72            The Hobbit House String Library
  4815.  
  4816.  
  4817.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4818.      ║ LASTBLK.C    ║   file date: 03/13/93    page   1 of   1 ║ LASTBLK.C    ║
  4819.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4820.  
  4821.      /*                       ┌───────────────────────┐            ptrlastblank
  4822.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4823.                               └───────────────────────┘
  4824.                                copyright(c) 1992, 1993
  4825.      
  4826.      function:       ptrlastblank (get PoinTeR to LAST BLANK)
  4827.      
  4828.      KWIC:           get the pointer to the %last %blank in a string
  4829.      
  4830.      syntax:         #include "hhstring.h"
  4831.                      char *ptrlastblank(char *string)
  4832.      
  4833.      description:    gets a pointer to the first blank found when scanning
  4834.                      backwards from the end of the specified string.
  4835.      
  4836.      returns:        a pointer to the last blank in a string (NULL if there
  4837.                      are no blanks in the string)
  4838.      
  4839.      comments:       none
  4840.      
  4841.      keywords:       pointer, last, character, blank
  4842.      
  4843.      key sentence:   gets the pointer to the last occurrence in a string of
  4844.                      a blank character
  4845.      
  4846.      see also:       ptr< first | last | next | prev >{not}blank
  4847.                      ptr< first | last | next | prev >{not}white
  4848.      
  4849.      usage example:  compiled/executed/verified on 1/7/93
  4850.      
  4851.                      char *Astring = "This is the Sample string";
  4852.                      printf("\n%s", ptrlastblank(Astring));
  4853.                      printf("\n%s", ptrlastblank("no_blanks_in_this_string"));
  4854.      
  4855.                       string
  4856.                      (null)
  4857.      
  4858.                               ┌───────────────────────┐
  4859.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4860.                               └───────────────────────┘                      */
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.                          The Hobbit House String Library               page  73
  4876.  
  4877.  
  4878.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4879.      ║ LASTCHR.C    ║   file date: 03/13/93    page   1 of   1 ║ LASTCHR.C    ║
  4880.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4881.  
  4882.      /*                       ┌───────────────────────┐              ptrlastchr
  4883.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4884.                               └───────────────────────┘
  4885.                                copyright(c) 1992, 1993
  4886.      
  4887.      function:       ptrlastchr (get PoinTeR to LAST occurrence of a CHaRacter)
  4888.      
  4889.      KWIC:           get the pointer to the %last occurrence of a %character in
  4890.                      a string
  4891.      
  4892.      syntax:         #include "hhstring.h"
  4893.                      char *ptrlastchr(char *ptr, char findchar)
  4894.      
  4895.      description:    gets a pointer to the first occurrence of a character
  4896.                      found when scanning backwards from the end of the
  4897.                      specified string.
  4898.      
  4899.      returns:        a pointer to the last occurrence of a character in
  4900.                      a string (NULL if the character does not occur in the
  4901.                      string)
  4902.      
  4903.      comments:       none
  4904.      
  4905.      keywords:       pointer, last, character
  4906.      
  4907.      key sentence:   gets the pointer to the last occurrence in a string of
  4908.                      a specified character
  4909.      
  4910.      see also:       ptr< first | last | next | prev >{not}chr{i}
  4911.      
  4912.      usage example:  compiled/executed/verified on 1/7/93
  4913.      
  4914.                      char *Astring = "This is the Sample string";
  4915.                      printf("%s", ptrlastchr(Astring, 'S'));
  4916.      
  4917.                      Sample string
  4918.      
  4919.                               ┌───────────────────────┐
  4920.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4921.                               └───────────────────────┘                      */
  4922.  
  4923.  
  4924.  
  4925.  
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.      page  74            The Hobbit House String Library
  4937.  
  4938.  
  4939.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  4940.      ║ LASTCHRI.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTCHRI.C   ║
  4941.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  4942.  
  4943.      /*                       ┌───────────────────────┐             ptrlastchri
  4944.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  4945.                               └───────────────────────┘
  4946.                                copyright(c) 1992, 1993
  4947.      
  4948.      function:       ptrlastchri (get PoinTeR to LAST occurrence of a
  4949.                                                                      CHaRacter,
  4950.                                  Independant of case)
  4951.      
  4952.      KWIC:           get the pointer to the %last occurrence, independent of
  4953.                      case, of a %character in a string
  4954.      
  4955.      syntax:         #include "hhstring.h"
  4956.                      char *ptrlastchri(char *ptr, char findchar)
  4957.      
  4958.      description:    gets a pointer to the first occurrence of a character,
  4959.                      independent of case, found when scanning backwards from
  4960.                      the end of the specified string.
  4961.      
  4962.      returns:        a pointer to the last occurrence, independent of case, of
  4963.                      a character in a string (NULL if the character does not
  4964.                      occur in the string)
  4965.      
  4966.      comments:       none
  4967.      
  4968.      keywords:       pointer, last, character, case-independent
  4969.      
  4970.      key sentence:   gets the pointer to the last occurrence in a string,
  4971.                      independent of case, of a given character
  4972.      
  4973.      see also:       ptr< first | last | next | prev >{not}chr{i}
  4974.      
  4975.      usage example:  compiled/executed/verified on 1/7/93
  4976.      
  4977.                      char *Astring = "This is the Sample string";
  4978.                      printf("%s", ptrlastchri(Astring, 'S'));
  4979.      
  4980.                      string
  4981.      
  4982.                               ┌───────────────────────┐
  4983.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  4984.                               └───────────────────────┘                      */
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997.                          The Hobbit House String Library               page  75
  4998.  
  4999.  
  5000.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5001.      ║ LASTDIG.C    ║   file date: 03/13/93    page   1 of   1 ║ LASTDIG.C    ║
  5002.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5003.  
  5004.      /*                       ┌───────────────────────┐              ptrlastdig
  5005.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5006.                               └───────────────────────┘
  5007.                                copyright(c) 1992, 1993
  5008.      
  5009.      function:       ptrlastdig (get PoinTer to LAST decimal DIGit in a string)
  5010.      
  5011.      KWIC:           get the pointer to the %last %decimal digit in a string
  5012.      
  5013.      syntax:         #include "hhstring.h"
  5014.                      char *ptrlastdig(char *string)
  5015.      
  5016.      description:    gets a pointer to the first decimal digit found when
  5017.                      scanning backwards from the end of the specified string.
  5018.      
  5019.      returns:        a pointer to the last decimal digit in a string (NULL if
  5020.                      there are no hex decimal in the string)
  5021.      
  5022.      comments:       none
  5023.      
  5024.      keywords:       pointer, last, decimal, digit
  5025.      
  5026.      key sentence:   gets the pointer to the last occurrence in a string of
  5027.                      any character which is a decimal digit
  5028.      
  5029.      see also:       ptr< first | last | next | prev >{not}dig
  5030.                      ptr< first | last | next | prev >{not}hex
  5031.      
  5032.      usage example:  compiled/executed/verified on 1/7/93
  5033.      
  5034.                      char *Astring = " 123 abc this is it";
  5035.                      printf("\n%s", ptrlastdig(Astring));
  5036.                      printf("\n%s", ptrlastdig("no digits in this string"));
  5037.      
  5038.                      3 abc this is it
  5039.                      (null)
  5040.      
  5041.                               ┌───────────────────────┐
  5042.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5043.                               └───────────────────────┘                      */
  5044.  
  5045.  
  5046.  
  5047.  
  5048.  
  5049.  
  5050.  
  5051.  
  5052.  
  5053.  
  5054.  
  5055.  
  5056.  
  5057.  
  5058.      page  76            The Hobbit House String Library
  5059.  
  5060.  
  5061.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5062.      ║ LASTGR.C     ║   file date: 03/13/93    page   1 of   1 ║ LASTGR.C     ║
  5063.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5064.  
  5065.      /*                       ┌───────────────────────┐               ptrlastgr
  5066.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5067.                               └───────────────────────┘
  5068.                                copyright(c) 1992, 1993
  5069.      
  5070.      function:       ptrlastgr (get PoinTeR to LAST occurrence of any character
  5071.                                  out of a GRoup of characters)
  5072.      
  5073.      KWIC:           get the pointer to the %last occurrence of a character
  5074.                                                                          from a
  5075.                      %group of characters
  5076.      
  5077.      syntax:         #include "hhstring.h"
  5078.                      char *ptrlastgr(char *instring, char *chars)
  5079.      
  5080.      description:    returns the pointer to the the last occurrence in instring
  5081.                      of any character which is in chars
  5082.      
  5083.      returns:        a pointer to the character found, or a NULL if none
  5084.                      are found
  5085.      
  5086.      comments:       none
  5087.      
  5088.      keywords:       pointer, last, character, group
  5089.      
  5090.      key sentence:   gets the pointer to the last occurrence in a string of
  5091.                      any character which is one of a given group of characters
  5092.      
  5093.      see also:       ptr< first | last | next | prev >{not}range
  5094.                      ptr< first | last | next | prev >{not}gr
  5095.      
  5096.      usage example:  compiled/executed/verified on 2/4/93
  5097.      
  5098.                      char *Astring = "This is it: the Sample string";
  5099.                      printf("\n%s", ptrlastgr(Astring, ".,;:!?"));
  5100.                      printf("\n%s", ptrlastgr(Astring, "+-=()"));
  5101.      
  5102.                      : the Sample string
  5103.                      (null)
  5104.      
  5105.                               ┌───────────────────────┐
  5106.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5107.                               └───────────────────────┘                      */
  5108.  
  5109.  
  5110.  
  5111.  
  5112.  
  5113.  
  5114.  
  5115.  
  5116.  
  5117.  
  5118.  
  5119.                          The Hobbit House String Library               page  77
  5120.  
  5121.  
  5122.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5123.      ║ LASTHEX.C    ║   file date: 03/13/93    page   1 of   1 ║ LASTHEX.C    ║
  5124.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5125.  
  5126.      /*                       ┌───────────────────────┐              ptrlasthex
  5127.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5128.                               └───────────────────────┘
  5129.                                copyright(c) 1992, 1993
  5130.      
  5131.      function:       ptrlasthex (get PoinTeR to LAST HEX digit in a string)
  5132.      
  5133.      KWIC:           get the pointer to the %last %hex digit in a string
  5134.      
  5135.      syntax:         #include "hhstring.h"
  5136.                      char *ptrlasthex(char *string)
  5137.      
  5138.      description:    gets a pointer to the first hex digit found when scanning
  5139.                      backwards from the end of the specified string.
  5140.      
  5141.      returns:        a pointer to the last hex digit in a string (NULL if there
  5142.                      are no hex digits in the string)
  5143.      
  5144.      comments:       none
  5145.      
  5146.      keywords:       pointer, last, hex, digit
  5147.      
  5148.      key sentence:   gets the pointer to the last occurrence in a string of
  5149.                      any character which is a hex digit
  5150.      
  5151.      see also:       ptr< first | last | next | prev >{not}dig
  5152.                      ptr< first | last | next | prev >{not}hex
  5153.      
  5154.      usage example:  compiled/executed/verified on 1/7/93
  5155.      
  5156.                      char *Astring = " 123 abc this is it";
  5157.                      printf("\n%s", ptrlasthex(Astring));
  5158.      
  5159.                      c this is it
  5160.      
  5161.                               ┌───────────────────────┐
  5162.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5163.                               └───────────────────────┘                      */
  5164.  
  5165.  
  5166.  
  5167.  
  5168.  
  5169.  
  5170.  
  5171.  
  5172.  
  5173.  
  5174.  
  5175.  
  5176.  
  5177.  
  5178.  
  5179.  
  5180.      page  78            The Hobbit House String Library
  5181.  
  5182.  
  5183.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5184.      ║ LASTNOBK.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTNOBK.C   ║
  5185.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5186.  
  5187.      /*                       ┌───────────────────────┐         ptrlastnotblank
  5188.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5189.                               └───────────────────────┘
  5190.                                copyright(c) 1992, 1993
  5191.      
  5192.      function:       ptrlastnotblank (get PoinTeR to LAST NOT-BLANK)
  5193.      
  5194.      KWIC:           get the pointer to the %last %non-blank in a string
  5195.      
  5196.      syntax:         #include "hhstring.h"
  5197.                      char *ptrlastnotblank(char *string)
  5198.      
  5199.      description:    gets a pointer to the first non-blank found when scanning
  5200.                      backwards from the end of the specified string.
  5201.      
  5202.      returns:        a pointer to the last non-blank in a string (NULL if there
  5203.                      are only blanks in the string, or if it is empty)
  5204.      
  5205.      comments:       none
  5206.      
  5207.      keywords:       pointer, last, character, not, blank
  5208.      
  5209.      key sentence:   gets the pointer to the last occurrence in a string of
  5210.                      any character which is not a blank
  5211.      
  5212.      see also:       ptr< first | last | next | prev >{not}blank
  5213.                      ptr< first | last | next | prev >{not}white
  5214.      
  5215.      usage example:  compiled/executed/verified on 1/7/93
  5216.      
  5217.                      char *Astring = "   This is the Sample string   ";
  5218.                      printf("\n-->%s<--", ptrlastnotblank(Astring));
  5219.                      printf("\n-->%s<--", ptrlastnotblank("     "));
  5220.      
  5221.                      -->g   <--
  5222.                      -->(null)<--
  5223.      
  5224.                               ┌───────────────────────┐
  5225.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5226.                               └───────────────────────┘                      */
  5227.  
  5228.  
  5229.  
  5230.  
  5231.  
  5232.  
  5233.  
  5234.  
  5235.  
  5236.  
  5237.  
  5238.  
  5239.  
  5240.  
  5241.                          The Hobbit House String Library               page  79
  5242.  
  5243.  
  5244.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5245.      ║ LASTNOCH.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTNOCH.C   ║
  5246.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5247.  
  5248.      /*                       ┌───────────────────────┐           ptrlastnotchr
  5249.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5250.                               └───────────────────────┘
  5251.                                copyright(c) 1992, 1993
  5252.      
  5253.      function:       ptrlastnotchr (get PoinTeR, to LAST, NOT the CHaRacter)
  5254.      
  5255.      KWIC:           get the pointer to the %last occurrence of a character in
  5256.                      a string which is not the specified %character
  5257.      
  5258.      syntax:         #include "hhstring.h"
  5259.                      char *ptrlastnotchr(char *ptr, char findchar)
  5260.      
  5261.      description:    gets a pointer to the first occurrence of any character
  5262.                      found, when scanning backwards from the end of the
  5263.                      specified string, which is not the specified character.
  5264.      
  5265.      returns:        a pointer to the character found (NULL if the string
  5266.                      consists of nothing but the specified character or is
  5267.                      empty)
  5268.      
  5269.      comments:       none
  5270.      
  5271.      keywords:       pointer, last, not, character
  5272.      
  5273.      key sentence:   gets the pointer to the last occurrence in a string of
  5274.                      any character other than a specified character
  5275.      
  5276.      see also:       ptr< first | last | next | prev >{not}chr{i}
  5277.      
  5278.      usage example:  compiled/executed/verified on 1/7/93
  5279.      
  5280.                      char *Astring = "This is the Sample string.......";
  5281.                      printf("\n%s", ptrlastnotchr(Astring, '.'));
  5282.                      printf("\n%s", ptrlastnotchr(".......", '.'));
  5283.      
  5284.                      g.......
  5285.                      (null)
  5286.      
  5287.                               ┌───────────────────────┐
  5288.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5289.                               └───────────────────────┘                      */
  5290.  
  5291.  
  5292.  
  5293.  
  5294.  
  5295.  
  5296.  
  5297.  
  5298.  
  5299.  
  5300.  
  5301.  
  5302.      page  80            The Hobbit House String Library
  5303.  
  5304.  
  5305.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5306.      ║ LASTNOCI.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTNOCI.C   ║
  5307.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5308.  
  5309.      /*                       ┌───────────────────────┐          ptrlastnotchri
  5310.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5311.                               └───────────────────────┘
  5312.                                copyright(c) 1992, 1993
  5313.      
  5314.      function:       ptrlastnotchri (get PoinTeR, to LAST, NOT a CHaRacter,
  5315.                                      Independant of case)
  5316.      
  5317.      KWIC:           get the pointer to the %last occurrence, %independent of
  5318.                      case, of a character which is not the specified %character
  5319.      
  5320.      syntax:         #include "hhstring.h"
  5321.                      char *ptrlastnotchri(char *ptr, char findchar)
  5322.      
  5323.      description:    gets a pointer to the first occurrence of any character,
  5324.                      independent of case, found when scanning backwards from
  5325.                      the end of the specified string, which is not the
  5326.                      specified character
  5327.      
  5328.      returns:        a pointer to the character found (NULL if the string
  5329.                      consists only of the specified characters or is empty.
  5330.      
  5331.      comments:       none
  5332.      
  5333.      keywords:       pointer, last, character, not, case-independent
  5334.      
  5335.      key sentence:   gets the pointer to the last occurrence in a string of
  5336.                      any character which, independent of case, is not a
  5337.                      specified character
  5338.      
  5339.      see also:       ptr< first | last | next | prev >{not}chr{i}
  5340.      
  5341.      usage example:  compiled/executed/verified on 1/7/93
  5342.      
  5343.                      char *Astring = "*******this is it*******";
  5344.                      printf("%s", ptrlastnotchri(Astring, '*'));
  5345.      
  5346.                      t*******
  5347.      
  5348.                               ┌───────────────────────┐
  5349.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5350.                               └───────────────────────┘                      */
  5351.  
  5352.  
  5353.  
  5354.  
  5355.  
  5356.  
  5357.  
  5358.  
  5359.  
  5360.  
  5361.  
  5362.  
  5363.                          The Hobbit House String Library               page  81
  5364.  
  5365.  
  5366.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5367.      ║ LASTNODG.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTNODG.C   ║
  5368.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5369.  
  5370.      /*                       ┌───────────────────────┐           ptrlastnotdig
  5371.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5372.                               └───────────────────────┘
  5373.                                copyright(c) 1992, 1993
  5374.      
  5375.      function:       ptrlastnotdig (get PoinTer to LAST character in a string
  5376.                                     which is NOT a decimal DIGit)
  5377.      
  5378.      KWIC:           get the pointer to the %last character in a string which
  5379.                      is not a %decimal digit
  5380.      
  5381.      syntax:         #include "hhstring.h"
  5382.                      char *ptrlastnotdig(char *string)
  5383.      
  5384.      description:    gets the pointer to the last character in string which is
  5385.                      not a decimal digit
  5386.      
  5387.      returns:        a pointer to the character, or NULL if none are found
  5388.      
  5389.      comments:       none
  5390.      
  5391.      keywords:       pointer, last, character, not, decimal, digit
  5392.      
  5393.      key sentence:   gets the pointer to the last occurrence in a string of
  5394.                      any character which is not a decimal digit
  5395.      
  5396.      see also:       ptr< first | last | next | prev >{not}dig
  5397.                      ptr< first | last | next | prev >{not}hex
  5398.      
  5399.      usage example:  compiled/executed/verified on 1/7/93
  5400.      
  5401.                      char *Astring = "value is: 12345";
  5402.                      printf("\n%s", ptrlastnotdig(Astring));
  5403.                      printf("\n%s", ptrlastnotdig("123456"));
  5404.      
  5405.                        12345
  5406.                       (null)
  5407.      
  5408.                               ┌───────────────────────┐
  5409.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5410.                               └───────────────────────┘                      */
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416.  
  5417.  
  5418.  
  5419.  
  5420.  
  5421.  
  5422.  
  5423.  
  5424.      page  82            The Hobbit House String Library
  5425.  
  5426.  
  5427.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5428.      ║ LASTNOGR.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTNOGR.C   ║
  5429.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5430.  
  5431.      /*                       ┌───────────────────────┐            ptrlastnotgr
  5432.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5433.                               └───────────────────────┘
  5434.                                copyright(c) 1992, 1993
  5435.      
  5436.      function:       ptrlastnotgr (get PoinTeR to LAST occurrence of a
  5437.                                     character which is NOT in a GRoup of
  5438.                                     characters)
  5439.      
  5440.      KWIC:           get the pointer to the %last occurrence of any character
  5441.                      which is not in a %group of characters
  5442.      
  5443.      syntax:         #include "hhstring.h"
  5444.                      char *ptrlastnotgr(char *instring, char *chars)
  5445.      
  5446.      description:    gets the pointer to the last occurrence in instring of any
  5447.                      character which is not in chars
  5448.      
  5449.      returns:        a pointer to the character found, or NULL if none found
  5450.      
  5451.      comments:       none
  5452.      
  5453.      keywords:       pointer, last, character, not, group
  5454.      
  5455.      key sentence:   gets the pointer to the last occurrence in a string of
  5456.                      any character which is not in a given group of characters
  5457.      
  5458.      see also:       ptr< first | last | next | prev >{not}range
  5459.                      ptr< first | last | next | prev >{not}gr
  5460.      
  5461.      usage example:  compiled/executed/verified on 2/4/93
  5462.      
  5463.                      char *Astring = "this is it:  -123,456,789.012  ";
  5464.                      printf("\n%s<--", ptrlastnotgr(Astring, "this "));
  5465.                      printf("\n%s", ptrlastnotgr("ababca", "abc"));
  5466.      
  5467.                      2  <--
  5468.                      (null)
  5469.      
  5470.                               ┌───────────────────────┐
  5471.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5472.                               └───────────────────────┘                      */
  5473.  
  5474.  
  5475.  
  5476.  
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.  
  5485.                          The Hobbit House String Library               page  83
  5486.  
  5487.  
  5488.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5489.      ║ LASTNOHX.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTNOHX.C   ║
  5490.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5491.  
  5492.      /*                       ┌───────────────────────┐           ptrlastnothex
  5493.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5494.                               └───────────────────────┘
  5495.                                copyright(c) 1992, 1993
  5496.      
  5497.      function:       ptrlastnothex (get PoinTeR to LAST character in a string
  5498.                                     which is NOT a HEX digit)
  5499.      
  5500.      KWIC:           get the pointer to the %last %hex digit in a string
  5501.      
  5502.      syntax:         #include "hhstring.h"
  5503.                      char *ptrlastnothex(char *string)
  5504.      
  5505.      description:    gets a pointer to the first hex digit found when scanning
  5506.                      backwards from the end of the specified string.
  5507.      
  5508.      returns:        a pointer to the last hex digit in a string (NULL if there
  5509.                      are no hex digits in the string)
  5510.      
  5511.      comments:       none
  5512.      
  5513.      keywords:       pointer, last, character, not, hex, digit
  5514.      
  5515.      key sentence:   gets the pointer to the last occurrence in a string of
  5516.                      any character which is not a hex digit
  5517.      
  5518.      see also:       ptr< first | last | next | prev >{not}dig
  5519.                      ptr< first | last | next | prev >{not}hex
  5520.      
  5521.      usage example:  compiled/executed/verified on 1/7/93
  5522.      
  5523.                      char *Astring = "value is: 1a23fe5";
  5524.                      printf("\n%s", ptrlastnothex(Astring));
  5525.                      printf("\n%s", ptrlastnothex("123abc"));
  5526.      
  5527.                       1a23fe5
  5528.                      (null)
  5529.      
  5530.                               ┌───────────────────────┐
  5531.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5532.                               └───────────────────────┘                      */
  5533.  
  5534.  
  5535.  
  5536.  
  5537.  
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.      page  84            The Hobbit House String Library
  5547.  
  5548.  
  5549.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5550.      ║ LASTNORN.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTNORN.C   ║
  5551.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5552.  
  5553.      /*                       ┌───────────────────────┐         ptrlastnotrange
  5554.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5555.                               └───────────────────────┘
  5556.                                copyright(c) 1992, 1993
  5557.      
  5558.      function:       ptrlastnotrange (get PoinTeR, to LAST, NOT in RANGE)
  5559.      
  5560.      KWIC:           get the pointer to the %last occurrence in a string of any
  5561.                      character which is not in a %range of characters
  5562.      
  5563.      syntax:         #include "hhstring.h"
  5564.                      char *ptrlastnotrange(char *instring, char c1, char c2)
  5565.      
  5566.      description:    gets the pointer to the last character in instring which
  5567.                      is not in the range c1 to c2 inclusive
  5568.      
  5569.      returns:        a pointer to the character found, or NULL if none are
  5570.                      found
  5571.      
  5572.      comments:       none
  5573.      
  5574.      keywords:       pointer, last, character, not, range
  5575.      
  5576.      key sentence:   gets the pointer to the last occurrence in a string of
  5577.                      any character which is not in a given range of characters
  5578.      
  5579.      see also:       ptr< first | last | next | prev >{not}range
  5580.                      ptr< first | last | next | prev >{not}set
  5581.      
  5582.      usage example:  compiled/executed/verified on 1/7/93
  5583.      
  5584.                      char *Astring = "This is the {Sample} String";
  5585.                      printf("\n%s", ptrlastnotrange(Astring, ' ', 'z'));
  5586.                      printf("\n%s", ptrlastnotrange("abcdef", 'a', 'f'));
  5587.      
  5588.                      } string
  5589.                      (null)
  5590.      
  5591.                               ┌───────────────────────┐
  5592.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5593.                               └───────────────────────┘                      */
  5594.  
  5595.  
  5596.  
  5597.  
  5598.  
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  
  5607.                          The Hobbit House String Library               page  85
  5608.  
  5609.  
  5610.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5611.      ║ LASTNOTT.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTNOTT.C   ║
  5612.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5613.  
  5614.      /*                       ┌───────────────────────┐      ptrlastnottextterm
  5615.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5616.                               └───────────────────────┘
  5617.                                copyright(c) 1992, 1993
  5618.      
  5619.      function:       ptrlastnottextterm (get PoinTeR to LAST
  5620.                                          NOT-TEXT-TERMinator)
  5621.      
  5622.      KWIC:           get the pointer to the %last character in a string other
  5623.                      than %text word terminators
  5624.      
  5625.      syntax:         #include "hhstring.h"
  5626.                      char *ptrlastnottextterm(char *string)
  5627.      
  5628.      description:    gets a pointer to the first character found when scanning
  5629.                      backwards from the end of the specified string, which is
  5630.                      not a text word terminator. I.E. not in the set
  5631.                      "\n\t\f\r\v.!?:;, "
  5632.      
  5633.      returns:        a pointer to the last non-wordterminator character in a
  5634.                      string (NULL if there are only word terminators in the
  5635.                      string)
  5636.      
  5637.      comments:       a "text word" is a human language construct as opposed to
  5638.                      a "string word" which is simply a set of characters
  5639.                      surrounded by whitespace. The only distinction made by
  5640.                      this function library is in the terminator. "Words" are
  5641.                      terminated by a blank, a tab, an ASCII End-Of-Line (EOL)
  5642.                      or an End-Of-String (EOS). "Text words", however, may also
  5643.                      be terminated by any of these punctuation marks: .!?:;,
  5644.      
  5645.      keywords:       pointer, last, character, not, terminator, text, word
  5646.      
  5647.      key sentence:   gets the pointer to the last occurrence in a string of
  5648.                      any character which is not a text word terminator
  5649.      
  5650.      see also:       ptr< first | last | next | prev >textterm
  5651.      
  5652.      usage example:  compiled/executed/verified on 1/30/93
  5653.      
  5654.                      char *Astring = "This is the Sample string .  \t ?  \n";
  5655.                      printf("-->%s<--", ptrlastnottextterm(Astring));
  5656.      
  5657.                      -->g .          ?
  5658.                      <--
  5659.      
  5660.                               ┌───────────────────────┐
  5661.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5662.                               └───────────────────────┘                      */
  5663.  
  5664.  
  5665.  
  5666.  
  5667.  
  5668.      page  86            The Hobbit House String Library
  5669.  
  5670.  
  5671.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5672.      ║ LASTNOWH.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTNOWH.C   ║
  5673.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5674.  
  5675.      /*                       ┌───────────────────────┐         ptrlastnotwhite
  5676.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5677.                               └───────────────────────┘
  5678.                                copyright(c) 1992, 1993
  5679.      
  5680.      function:       ptrlastnotwhite (get PoinTeR to LAST NOT-WHITE)
  5681.      
  5682.      KWIC:           get the pointer to the %last %non-whitespace character in
  5683.                      a string
  5684.      
  5685.      syntax:         #include "hhstring.h"
  5686.                      char *ptrlastnotwhite(char *string)
  5687.      
  5688.      description:    gets a pointer to the first non-whitespace character
  5689.                      found when scanning backwards from the end of the
  5690.                      specified string.
  5691.      
  5692.      returns:        a pointer to the last non-whitespace character in a
  5693.                      string (NULL if there is only whitespace in the string)
  5694.      
  5695.      comments:       none
  5696.      
  5697.      keywords:       pointer, last, character, not, whitespace, blank, tab
  5698.      
  5699.      key sentence:   gets the pointer to the last occurrence in a string of
  5700.                      any character which is not whitespace (a blank or a tab)
  5701.      
  5702.      see also:       ptr< first | last | next | prev >{not}blank
  5703.                      ptr< first | last | next | prev >{not}white
  5704.      
  5705.      usage example:  compiled/executed/verified on 1/7/93
  5706.      
  5707.                      char *Astring = "This is the Sample string      ";
  5708.                      printf("-->%s<--", ptrlastnotwhite(Astring));
  5709.      
  5710.                      -->g      <--
  5711.      
  5712.                               ┌───────────────────────┐
  5713.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5714.                               └───────────────────────┘                      */
  5715.  
  5716.  
  5717.  
  5718.  
  5719.  
  5720.  
  5721.  
  5722.  
  5723.  
  5724.  
  5725.  
  5726.  
  5727.  
  5728.  
  5729.                          The Hobbit House String Library               page  87
  5730.  
  5731.  
  5732.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5733.      ║ LASTNOWT.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTNOWT.C   ║
  5734.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5735.  
  5736.      /*                       ┌───────────────────────┐      ptrlastnotwordterm
  5737.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5738.                               └───────────────────────┘
  5739.                                copyright(c) 1992, 1993
  5740.      
  5741.      function:       ptrlastnotwordterm (get PoinTeR to LAST
  5742.                                          NOT-WORD-TERMinator)
  5743.      
  5744.      KWIC:           get the pointer to the %last character in a string other
  5745.                      than %word terminators
  5746.      
  5747.      syntax:         #include "hhstring.h"
  5748.                      char *ptrlastnotwordterm(char *string)
  5749.      
  5750.      description:    gets a pointer to the first character found when scanning
  5751.                      backwards from the end of the specified string, which is
  5752.                      not a word terminator. I.E. not in the set " \n\t\f\r\v"
  5753.      
  5754.      returns:        a pointer to the last non-wordterminator character in a
  5755.                      string (NULL if there are only word terminators in the
  5756.                      string)
  5757.      
  5758.      comments:       none
  5759.      
  5760.      keywords:       pointer, last, character, not, word, terminator
  5761.      
  5762.      key sentence:   gets the pointer to the last occurrence in a string of
  5763.                      any character which is not a word terminator
  5764.      
  5765.      see also:       ptr< first | last | next | prev >{not}< blank | white >
  5766.                      ptr< first | last | next | prev >{not}< word | text >term
  5767.      
  5768.      usage example:  compiled/executed/verified on 2/27/93
  5769.      
  5770.                      char *Astring = "This is the Sample string   \t   \n";
  5771.                      printf("-->%s<--", ptrlastnotwordterm(Astring));
  5772.      
  5773.                      -->g                                 tab expansion doesn't
  5774.                      <--                                  show, but is present
  5775.      
  5776.                               ┌───────────────────────┐
  5777.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5778.                               └───────────────────────┘                      */
  5779.  
  5780.  
  5781.  
  5782.  
  5783.  
  5784.  
  5785.  
  5786.  
  5787.  
  5788.  
  5789.  
  5790.      page  88            The Hobbit House String Library
  5791.  
  5792.  
  5793.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5794.      ║ LASTRAN.C    ║   file date: 03/13/93    page   1 of   1 ║ LASTRAN.C    ║
  5795.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5796.  
  5797.      /*                       ┌───────────────────────┐            ptrlastrange
  5798.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5799.                               └───────────────────────┘
  5800.                                copyright(c) 1992, 1993
  5801.      
  5802.      function:       ptrlastrange (get PoinTeR, to LAST, from RANGE)
  5803.      
  5804.      KWIC:           get the pointer to the %last occurrence in a string of any
  5805.                      character in a %range of characters
  5806.      
  5807.      
  5808.      syntax:         #include "hhstring.h"
  5809.                      char *ptrlastrange(char *instring, char c1, char c2)
  5810.      
  5811.      description:    gets the pointer to the last occurrence in instring of any
  5812.                      character in the range c1 to c2 inclusive
  5813.      
  5814.      returns:        a pointer to the character found, or NULL if all
  5815.                      characters are out of the range
  5816.      
  5817.      comments:       none
  5818.      
  5819.      keywords:       pointer, last, character, range
  5820.      
  5821.      key sentence:   gets the pointer to the last occurrence in a string of
  5822.                      any character which is in a given range of characters
  5823.      
  5824.      see also:       ptr< first | last | next | prev >{not}range
  5825.                      ptr< first | last | next | prev >{not}set
  5826.      
  5827.      usage example:  compiled/executed/verified on 1/7/93
  5828.      
  5829.                      char *Astring = "This is it: the Sample string";
  5830.                      printf("\n%s", ptrlastrange(Astring, '!', '?'));
  5831.                      printf("\n%s", ptrlastrange(Astring, '!', '/'));
  5832.      
  5833.                      : the Sample string
  5834.                      (null)
  5835.      
  5836.                               ┌───────────────────────┐
  5837.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5838.                               └───────────────────────┘                      */
  5839.  
  5840.  
  5841.  
  5842.  
  5843.  
  5844.  
  5845.  
  5846.  
  5847.  
  5848.  
  5849.  
  5850.  
  5851.                          The Hobbit House String Library               page  89
  5852.  
  5853.  
  5854.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5855.      ║ LASTSUB.C    ║   file date: 03/13/93    page   1 of   1 ║ LASTSUB.C    ║
  5856.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5857.  
  5858.      /*                       ┌───────────────────────┐              ptrlastsub
  5859.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5860.                               └───────────────────────┘
  5861.                                copyright(c) 1992, 1993
  5862.      
  5863.      function:       ptrlastsub (get PoinTeR to LAST occurrence of a
  5864.                                                                     SUB-string)
  5865.      
  5866.      KWIC:           get the pointer to the %last occurrence of a %substring
  5867.      
  5868.      syntax:         #include <stddef.h>
  5869.                      #include "hhstring.h"
  5870.                      char *ptrlastsub(char *instring, char *substring)
  5871.      
  5872.      description:    returns a pointer to the last occurrence of substring in
  5873.                      string
  5874.      
  5875.      returns:        a pointer to the substring location, or a NULL if the
  5876.                      substring is not found
  5877.      
  5878.      comments:       none
  5879.      
  5880.      keywords:       pointer, last, substring
  5881.      
  5882.      key sentence:   gets the pointer to the last occurrence in a string of
  5883.                      a given substring
  5884.      
  5885.      see also:       ptr< first | last | next | prev >sub{i}
  5886.      
  5887.      usage example:  compiled/executed/verified on 1/7/93
  5888.      
  5889.                      char *Astring = "This is the Sample string";
  5890.                      printf("\n%s", ptrlastsub(Astring, "Sample"));
  5891.                      printf("\n%s", ptrlastsub(Astring, "not there"));
  5892.      
  5893.                      Sample string
  5894.                      (null)
  5895.      
  5896.                               ┌───────────────────────┐
  5897.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5898.                               └───────────────────────┘                      */
  5899.  
  5900.  
  5901.  
  5902.  
  5903.  
  5904.  
  5905.  
  5906.  
  5907.  
  5908.  
  5909.  
  5910.  
  5911.  
  5912.      page  90            The Hobbit House String Library
  5913.  
  5914.  
  5915.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5916.      ║ LASTSUBI.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTSUBI.C   ║
  5917.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5918.  
  5919.      /*                       ┌───────────────────────┐             ptrlastsubi
  5920.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5921.                               └───────────────────────┘
  5922.                                copyright(c) 1992, 1993
  5923.      
  5924.      function:       ptrlastsubi (get PoinTeR to LAST occurrence of a SUB-
  5925.                                   string, Independant of case)
  5926.      
  5927.      KWIC:           get the pointer to the %last occurrence, %independent of
  5928.                      case, of a %substring
  5929.      
  5930.      syntax:         #include <stddef.h>
  5931.                      #include "hhstring.h"
  5932.                      char *ptrlastsubi(char *instring, char *substring)
  5933.      
  5934.      description:    the last occurrence of
  5935.      
  5936.      returns:        a pointer to the substring location, or a NULL if the
  5937.                      substring is not found
  5938.      
  5939.      comments:       none
  5940.      
  5941.      keywords:       pointer, last, substring, case-independent
  5942.      
  5943.      key sentence:   gets the pointer to the last occurrence in a string,
  5944.                      independent of case, of a given substring
  5945.      
  5946.      see also:       ptr< first | last | next | prev >sub{i}
  5947.      
  5948.      usage example:  compiled/executed/verified on 1/7/93
  5949.      
  5950.                      char *Astring = "This is the Sample string";
  5951.                      printf("\n%s", ptrlastsubi(Astring, "SAMPLE"));
  5952.                      printf("\n%s", ptrlastsubi(Astring, "not there"));
  5953.      
  5954.                      Sample string
  5955.                      (null)
  5956.      
  5957.                               ┌───────────────────────┐
  5958.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  5959.                               └───────────────────────┘                      */
  5960.  
  5961.  
  5962.  
  5963.  
  5964.  
  5965.  
  5966.  
  5967.  
  5968.  
  5969.  
  5970.  
  5971.  
  5972.  
  5973.                          The Hobbit House String Library               page  91
  5974.  
  5975.  
  5976.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  5977.      ║ LASTTEXT.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTTEXT.C   ║
  5978.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  5979.  
  5980.      /*                       ┌───────────────────────┐             ptrlasttext
  5981.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  5982.                               └───────────────────────┘
  5983.                                copyright(c) 1992, 1993
  5984.      
  5985.      function:       ptrlasttext (get PoinTeR to LAST TEXT word)
  5986.      
  5987.      KWIC:           get the pointer to the %last %text word in a string
  5988.      
  5989.      syntax:         #include "hhstring.h"
  5990.                      char *ptrlasttext(char *string)
  5991.      
  5992.      description:    gets a pointer to the first text word found when scanning
  5993.                      backwards from the end of the specified string.
  5994.      
  5995.      returns:        a pointer to the last text word it the string (NULL if
  5996.                      there is only whitespace and punctuation in the string)
  5997.      
  5998.      comments:       a "text word" is a human language construct as opposed to
  5999.                      a "string word" which is simply a set of characters
  6000.                      surrounded by whitespace. The only distinction made by
  6001.                      this function library is in the terminator. "Words" are
  6002.                      terminated by a blank, a tab, an ASCII End-Of-Line (EOL)
  6003.                      or an End-Of-String (EOS). "Text words", however, may also
  6004.                      be terminated by any of these punctuation marks: .!?:;,
  6005.      
  6006.      keywords:       pointer, last, word, text
  6007.      
  6008.      key sentence:   gets the pointer to the last text word in a string
  6009.      
  6010.      see also:       ptr< first | last | next | this | prev>text
  6011.      
  6012.      usage example:  compiled/executed/verified on 1/30/93
  6013.      
  6014.                      char *Astring = "This is the Sample string.";
  6015.                      printf("\n%s", ptrlasttext(Astring));
  6016.                      printf("\n%s", ptrlasttext("-----"));
  6017.                      printf("\n%s", ptrlasttext(" . \t ? "));
  6018.      
  6019.                      string.
  6020.                      ------
  6021.                      (null)
  6022.      
  6023.                               ┌───────────────────────┐
  6024.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  6025.                               └───────────────────────┘                      */
  6026.  
  6027.  
  6028.  
  6029.  
  6030.  
  6031.  
  6032.  
  6033.  
  6034.      page  92            The Hobbit House String Library
  6035.  
  6036.  
  6037.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6038.      ║ LASTTXTR.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTTXTR.C   ║
  6039.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6040.  
  6041.      /*                       ┌───────────────────────┐         ptrlasttextterm
  6042.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  6043.                               └───────────────────────┘
  6044.                                copyright(c) 1992, 1993
  6045.      
  6046.      function:       ptrlasttextterm (get PoinTeR to LAST TEXT TERMinator)
  6047.      
  6048.      KWIC:           get the pointer to the %last %text terminator in a string
  6049.      
  6050.      syntax:         #include "hhstring.h"
  6051.                      char *ptrlasttextterm(char *string)
  6052.      
  6053.      description:    gets a pointer to the first text terminator found when
  6054.                      scanning backwards from the end of the specified string.
  6055.      
  6056.      returns:        a pointer to the last text terminator in a string
  6057.                      (NULL if there are no blanks in the string)
  6058.      
  6059.      comments:       a "text word" is a human language construct as opposed to
  6060.                      a "string word" which is simply a set of characters
  6061.                      surrounded by whitespace. The only distinction made by
  6062.                      this function library is in the terminator. "Words" are
  6063.                      terminated by a blank, a tab, an ASCII End-Of-Line (EOL)
  6064.                      or an End-Of-String (EOS). "Text words", however, may also
  6065.                      be terminated by any of these punctuation marks: .!?:;,
  6066.      
  6067.      keywords:       pointer, last, character, text, terminator
  6068.      
  6069.      key sentence:   gets the pointer to the last occurrence in a string of
  6070.                      a text terminator character
  6071.      
  6072.      see also:       ptr< first | last | next | prev >textterm
  6073.      
  6074.      usage example:  compiled/executed/verified on 2/21/93
  6075.      
  6076.                      char *Astring = " was this. The sample string";
  6077.                      printf("\n%s", ptrlasttextterm(Astring));
  6078.                      printf("\n%s", ptrlasttextterm("no_terms_in_this_string"))
  6079.                                                                               ;
  6080.      
  6081.                       string
  6082.                      (null)
  6083.      
  6084.                               ┌───────────────────────┐
  6085.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  6086.                               └───────────────────────┘                      */
  6087.  
  6088.  
  6089.  
  6090.  
  6091.  
  6092.  
  6093.  
  6094.  
  6095.                          The Hobbit House String Library               page  93
  6096.  
  6097.  
  6098.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6099.      ║ LASTWH.C     ║   file date: 03/13/93    page   1 of   1 ║ LASTWH.C     ║
  6100.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6101.  
  6102.      /*                       ┌───────────────────────┐            ptrlastwhite
  6103.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  6104.                               └───────────────────────┘
  6105.                                copyright(c) 1992, 1993
  6106.      
  6107.      function:       ptrlastwhite (get PoinTeR to LAST WHITEspace)
  6108.      
  6109.      KWIC:           get the pointer to the %last %whitespace character in a
  6110.                      string
  6111.      
  6112.      syntax:         #include "hhstring.h"
  6113.                      char *ptrlastwhite(char *string)
  6114.      
  6115.      description:    gets a pointer to the first whitespace character found
  6116.                      when scanning backwards from the end of the specified
  6117.                      string.
  6118.      
  6119.      returns:        a pointer to the last whitespace character in a string
  6120.                      (NULL if there is no whitespace in the string)
  6121.      
  6122.      comments:       none
  6123.      
  6124.      keywords:       pointer, last, character, whitespace, blank, tab
  6125.      
  6126.      key sentence:   gets the pointer to the last occurrence in a string of
  6127.                      a whitespace character (a blank or a tab)
  6128.      
  6129.      see also:       ptr< first | last | next | prev >{not}blank
  6130.                      ptr< first | last | next | prev >{not}white
  6131.      
  6132.      usage example:  compiled/executed/verified on 1/7/93
  6133.      
  6134.                      char *Astring = "This is the Sample string";
  6135.                      printf("\n%s", ptrlastwhite(Astring));
  6136.                      printf("\n%s", ptrlastwhite("no_whitespace_here"));
  6137.      
  6138.                       string
  6139.                      (null)
  6140.      
  6141.                               ┌───────────────────────┐
  6142.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  6143.                               └───────────────────────┘                      */
  6144.  
  6145.  
  6146.  
  6147.  
  6148.  
  6149.  
  6150.  
  6151.  
  6152.  
  6153.  
  6154.  
  6155.  
  6156.      page  94            The Hobbit House String Library
  6157.  
  6158.  
  6159.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6160.      ║ LASTWORD.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTWORD.C   ║
  6161.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6162.  
  6163.      /*                       ┌───────────────────────┐             ptrlastword
  6164.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  6165.                               └───────────────────────┘
  6166.                                copyright(c) 1992, 1993
  6167.      
  6168.      function:       ptrlastword (get PoinTeR to LAST WORD)
  6169.      
  6170.      KWIC:           get the pointer to the %last %word in a string
  6171.      
  6172.      syntax:         #include "hhstring.h"
  6173.                      char *ptrlastword(char *string)
  6174.      
  6175.      description:    gets a pointer to the first word found when scanning
  6176.                      backwards from the end of the specified string.
  6177.      
  6178.      returns:        a pointer to the last word it the string (NULL if there
  6179.                      is only whitespace in the string)
  6180.      
  6181.      comments:       this function is not bothered by final EOL ('\n')
  6182.                      characters in a string
  6183.      
  6184.      keywords:       pointer, last, word
  6185.      
  6186.      key sentence:   gets the pointer to the last word in a string
  6187.      
  6188.      see also:       ptr< first | last | next | this | prev>word
  6189.      
  6190.      usage example:  compiled/executed/verified on 2/27/93
  6191.      
  6192.                      char *Astring = "This is the Sample string\n";
  6193.                      printf("\n%s", ptrlastword(Astring));
  6194.                      printf("\n%s", ptrlastword("--.--"));
  6195.                      printf("\n%s", ptrlastword("--.--:\n"));
  6196.                      printf("\n%s", ptrlastword("   \t   "));
  6197.      
  6198.                      string
  6199.      
  6200.                      --.--
  6201.                      --.--:
  6202.      
  6203.                      (null)
  6204.      
  6205.                               ┌───────────────────────┐
  6206.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  6207.                               └───────────────────────┘                      */
  6208.  
  6209.  
  6210.  
  6211.  
  6212.  
  6213.  
  6214.  
  6215.  
  6216.  
  6217.                          The Hobbit House String Library               page  95
  6218.  
  6219.  
  6220.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6221.      ║ LASTWDTR.C   ║   file date: 03/13/93    page   1 of   1 ║ LASTWDTR.C   ║
  6222.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6223.  
  6224.      /*                       ┌───────────────────────┐         ptrlastwordterm
  6225.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  6226.                               └───────────────────────┘
  6227.                                copyright(c) 1992, 1993
  6228.      
  6229.      function:       ptrlastwordterm (get PoinTeR to LAST WORD TERMinator)
  6230.      
  6231.      KWIC:           get the pointer to the %last %word terminator in a string
  6232.      
  6233.      syntax:         #include "hhstring.h"
  6234.                      char *ptrlastwordterm(char *string)
  6235.      
  6236.      description:    gets a pointer to the first word terminator found when
  6237.                      scanning backwards from the end of the specified string.
  6238.      
  6239.      returns:        a pointer to the last word terminator in a string
  6240.                      (NULL if there are no blanks in the string)
  6241.      
  6242.      comments:       none
  6243.      
  6244.      keywords:       pointer, last, character, word, terminator
  6245.      
  6246.      key sentence:   gets the pointer to the last occurrence in a string of
  6247.                      a word terminator character
  6248.      
  6249.      see also:       ptr< first | last | next | prev >wordterm
  6250.      
  6251.      usage example:  compiled/executed/verified on 1/31/93
  6252.      
  6253.                      char *Astring = " was this. The sample string";
  6254.                      printf("\n%s", ptrlastwordterm(Astring));
  6255.                      printf("\n%s", ptrlastwordterm("no_terms_in_this_string"))
  6256.                                                                               ;
  6257.      
  6258.                       string
  6259.                      (null)
  6260.      
  6261.                               ┌───────────────────────┐
  6262.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  6263.                               └───────────────────────┘                      */
  6264.  
  6265.  
  6266.  
  6267.  
  6268.  
  6269.  
  6270.  
  6271.  
  6272.  
  6273.  
  6274.  
  6275.  
  6276.  
  6277.  
  6278.      page  96            The Hobbit House String Library
  6279.  
  6280.  
  6281.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6282.      ║ NEXTBLK.C    ║   file date: 03/13/93    page   1 of   2 ║ NEXTBLK.C    ║
  6283.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6284.  
  6285.      /*                       ┌───────────────────────┐            ptrnextblank
  6286.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  6287.                               └───────────────────────┘
  6288.                                copyright(c) 1992, 1993
  6289.      
  6290.      function:       ptrnextblank (get PoinTeR to NEXT BLANK)
  6291.      
  6292.      KWIC:           get the pointer to the %next %blank in a string
  6293.      
  6294.      syntax:         #include "hhstring.h"
  6295.                      char *ptrnextblank(char *ptr)
  6296.      
  6297.      description:    this function returns a pointer to the first blank in
  6298.                      memory following the given pointer. if the pointer
  6299.                      points at a blank, that will NOT be the one pointed to
  6300.                      upon return.
  6301.      
  6302.      returns:        a pointer to the next blank
  6303.      
  6304.      comments:       like most of the ptrnext<...> functions, this one is a
  6305.                      macro which uses the corresponding ptrfirst<...>
  6306.                      function. The ptrnext<...> functions are maintained
  6307.                      primarily for the sake of consistency among the names
  6308.                      in HHSTRING. Also, the self-documented feature of the name
  6309.                      seems to us to outweigh the apparent ridiculousness of
  6310.                      maintaining a large group of macros which do nothing
  6311.                      more than add one to a pointer in a call to an existing
  6312.                      function.
  6313.      
  6314.      keywords:       pointer, next, character, blank
  6315.      
  6316.      key sentence:   gets the pointer to the next blank in a string
  6317.      
  6318.      see also:       ptr< first | last | next | prev >{not}blank
  6319.                      ptr< first | last | next | prev >{not}white
  6320.      
  6321.  
  6322.  
  6323.  
  6324.  
  6325.  
  6326.  
  6327.  
  6328.  
  6329.  
  6330.  
  6331.  
  6332.  
  6333.  
  6334.  
  6335.  
  6336.  
  6337.  
  6338.  
  6339.                          The Hobbit House String Library               page  97
  6340.  
  6341.  
  6342.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6343.      ║ NEXTBLK.C    ║   file date: 03/13/93    page   2 of   2 ║ NEXTBLK.C    ║
  6344.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6345.  
  6346.      
  6347.      
  6348.      usage example:  compiled/executed/verified on 12/21/92
  6349.      
  6350.                      char *Astring = "thisisthesample string";
  6351.                      printf("%s", ptrnextblank(Astring+5));
  6352.      
  6353.                       string
  6354.      
  6355.                               ┌───────────────────────┐
  6356.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  6357.                               └───────────────────────┘                      */
  6358.  
  6359.  
  6360.  
  6361.  
  6362.  
  6363.  
  6364.  
  6365.  
  6366.  
  6367.  
  6368.  
  6369.  
  6370.  
  6371.  
  6372.  
  6373.  
  6374.  
  6375.  
  6376.  
  6377.  
  6378.  
  6379.  
  6380.  
  6381.  
  6382.  
  6383.  
  6384.  
  6385.  
  6386.  
  6387.  
  6388.  
  6389.  
  6390.  
  6391.  
  6392.  
  6393.  
  6394.  
  6395.  
  6396.  
  6397.  
  6398.  
  6399.  
  6400.      page  98            The Hobbit House String Library
  6401.  
  6402.  
  6403.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6404.      ║ NEXTCHR.C    ║   file date: 03/13/93    page   1 of   2 ║ NEXTCHR.C    ║
  6405.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6406.  
  6407.      /*                       ┌───────────────────────┐              ptrnextchr
  6408.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  6409.                               └───────────────────────┘
  6410.                                copyright(c) 1992, 1993
  6411.      
  6412.      function:       ptrnextchr (get PoinTeR to NEXT occurrence of a specified
  6413.                                  CHaRacter)
  6414.      
  6415.      KWIC:           get the pointer to the %next occurrence in a string of a
  6416.                      specified %character
  6417.      
  6418.      syntax:         #include "hhstring.h"
  6419.                      char *ptrnextchr(char *ptr, char findchar)
  6420.      
  6421.      description:    this function returns a pointer to the next occurrence in
  6422.                      memory of the specified character, starting at the
  6423.                      specified pointer. If an EOS is encountered before any
  6424.                      occurrence of the character, then the return pointer will
  6425.                      be NULL.
  6426.      
  6427.      returns:        a pointer to the next occurrence of the character (NULL
  6428.                      if the character does not occur)
  6429.      
  6430.      comments:       like most of the ptrnext<...> functions, this one is a
  6431.                      macro which uses the corresponding ptrfirst<...>
  6432.                      function. The ptrnext<...> functions are maintained
  6433.                      primarily for the sake of consistency among the names
  6434.                      in HHSTRING. Also, the self-documented feature of the name
  6435.                      seems to us to outweigh the apparent ridiculousness of
  6436.                      maintaining a large group of macros which do nothing
  6437.                      more than add one to a pointer in a call to an existing
  6438.                      function.
  6439.      
  6440.      keywords:       pointer, next, character
  6441.      
  6442.      key sentence:   gets the pointer to the next occurrence of a specified
  6443.                      character in a string
  6444.      
  6445.      see also:       ptr< first | last | next | prev >{not}chr{i}
  6446.      
  6447.  
  6448.  
  6449.  
  6450.  
  6451.  
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.                          The Hobbit House String Library               page  99
  6462.  
  6463.  
  6464.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6465.      ║ NEXTCHR.C    ║   file date: 03/13/93    page   2 of   2 ║ NEXTCHR.C    ║
  6466.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6467.  
  6468.      
  6469.      
  6470.      usage example:  compiled/executed/verified on 12/15/92
  6471.      
  6472.                      char Astring[80] = "this is the Sample string";
  6473.                      printf("%s", ptrnextchr(Astring + 3, 's'));
  6474.      
  6475.                      s the sample string
  6476.      
  6477.                               ┌───────────────────────┐
  6478.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  6479.                               └───────────────────────┘                      */
  6480.  
  6481.  
  6482.  
  6483.  
  6484.  
  6485.  
  6486.  
  6487.  
  6488.  
  6489.  
  6490.  
  6491.  
  6492.  
  6493.  
  6494.  
  6495.  
  6496.  
  6497.  
  6498.  
  6499.  
  6500.  
  6501.  
  6502.  
  6503.  
  6504.  
  6505.  
  6506.  
  6507.  
  6508.  
  6509.  
  6510.  
  6511.  
  6512.  
  6513.  
  6514.  
  6515.  
  6516.  
  6517.  
  6518.  
  6519.  
  6520.  
  6521.  
  6522.      page 100            The Hobbit House String Library
  6523.  
  6524.  
  6525.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6526.      ║ NEXTCHRI.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTCHRI.C   ║
  6527.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6528.  
  6529.      /*                       ┌───────────────────────┐             ptrnextchri
  6530.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  6531.                               └───────────────────────┘
  6532.                                copyright(c) 1992, 1993
  6533.      
  6534.      function:       ptrnextchri (get PoinTeR to NEXT occurrence of a specified
  6535.                                   CHaRacter, independent of case)
  6536.      
  6537.      KWIC:           get the pointer to the %next occurrence in a string of a
  6538.                      specified %character, %independent of case
  6539.      
  6540.      syntax:         #include "hhstring.h"
  6541.                      char *ptrnextchri(char *ptr, char findchar)
  6542.      
  6543.      description:    this function returns a pointer to the next occurrence in
  6544.                      memory of the specified character, independent of case,
  6545.                      starting at the specified pointer. If an EOS is
  6546.                                                                     encountered
  6547.                      before any occurrence of the character, then the return
  6548.                      pointer will be NULL.
  6549.      
  6550.      returns:        a pointer to the next occurrence of the character,
  6551.                      independent of case (NULL if the character does not occur)
  6552.      
  6553.      comments:       like most of the ptrnext<...> functions, this one is a
  6554.                      macro which uses the corresponding ptrfirst<...>
  6555.                      function. The ptrnext<...> functions are maintained
  6556.                      primarily for the sake of consistency among the names
  6557.                      in HHSTRING. Also, the self-documented feature of the name
  6558.                      seems to us to outweigh the apparent ridiculousness of
  6559.                      maintaining a large group of macros which do nothing
  6560.                      more than add one to a pointer in a call to an existing
  6561.                      function.
  6562.      
  6563.      keywords:       pointer, next, character, case-independent
  6564.      
  6565.      key sentence:   gets the pointer to the next case-independent occurrence
  6566.                      of a specified character in a string
  6567.      
  6568.      see also:       ptr< first | last | next | prev >{not}chr{i}
  6569.      
  6570.  
  6571.  
  6572.  
  6573.  
  6574.  
  6575.  
  6576.  
  6577.  
  6578.  
  6579.  
  6580.  
  6581.  
  6582.  
  6583.                          The Hobbit House String Library               page 101
  6584.  
  6585.  
  6586.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6587.      ║ NEXTCHRI.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTCHRI.C   ║
  6588.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6589.  
  6590.      
  6591.      
  6592.      usage example:  compiled/executed/verified on 12/15/92
  6593.      
  6594.                      char Astring[80] = "this is the Sample string";
  6595.                      printf("%s", ptrnextchri(Astring, 'S'));
  6596.      
  6597.                      s is the Sample string
  6598.      
  6599.                               ┌───────────────────────┐
  6600.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  6601.                               └───────────────────────┘                      */
  6602.  
  6603.  
  6604.  
  6605.  
  6606.  
  6607.  
  6608.  
  6609.  
  6610.  
  6611.  
  6612.  
  6613.  
  6614.  
  6615.  
  6616.  
  6617.  
  6618.  
  6619.  
  6620.  
  6621.  
  6622.  
  6623.  
  6624.  
  6625.  
  6626.  
  6627.  
  6628.  
  6629.  
  6630.  
  6631.  
  6632.  
  6633.  
  6634.  
  6635.  
  6636.  
  6637.  
  6638.  
  6639.  
  6640.  
  6641.  
  6642.  
  6643.  
  6644.      page 102            The Hobbit House String Library
  6645.  
  6646.  
  6647.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6648.      ║ NEXTDIG.C    ║   file date: 03/13/93    page   1 of   2 ║ NEXTDIG.C    ║
  6649.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6650.  
  6651.      /*                       ┌───────────────────────┐              ptrnextdig
  6652.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  6653.                               └───────────────────────┘
  6654.                                copyright(c) 1992, 1993
  6655.      
  6656.      function:       ptrnextdig (get PoinTeR to NEXT decimal DIGit in a string)
  6657.      
  6658.      KWIC:           get the pointer to the %next %decimal digit in a string
  6659.      
  6660.      syntax:         #include "hhstring.h"
  6661.                      char *ptrnextdig(char *ptr)
  6662.      
  6663.      description:    this function returns a pointer to the first decimal
  6664.                      digit in memory following the given pointer. if the
  6665.                      pointer points at a decimal digit, that will NOT be the
  6666.                      one pointed to upon return.
  6667.      
  6668.      returns:        a pointer to the next decimal digit
  6669.      
  6670.      comments:       like most of the ptrnext<...> functions, this one is a
  6671.                      macro which uses the corresponding ptrfirst<...>
  6672.                      function. The ptrnext<...> functions are maintained
  6673.                      primarily for the sake of consistency among the names
  6674.                      in HHSTRING. Also, the self-documented feature of the name
  6675.                      seems to us to outweigh the apparent ridiculousness of
  6676.                      maintaining a large group of macros which do nothing
  6677.                      more than add one to a pointer in a call to an existing
  6678.                      function.
  6679.      
  6680.      keywords:       pointer, next, decimal, digit
  6681.      
  6682.      key sentence:   gets the pointer to the next decimal digit in a string
  6683.      
  6684.      see also:       ptr< first | last | next | prev >{not}dig
  6685.                      ptr< first | last | next | prev >{not}hex
  6686.      
  6687.  
  6688.  
  6689.  
  6690.  
  6691.  
  6692.  
  6693.  
  6694.  
  6695.  
  6696.  
  6697.  
  6698.  
  6699.  
  6700.  
  6701.  
  6702.  
  6703.  
  6704.  
  6705.                          The Hobbit House String Library               page 103
  6706.  
  6707.  
  6708.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6709.      ║ NEXTDIG.C    ║   file date: 03/13/93    page   2 of   2 ║ NEXTDIG.C    ║
  6710.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6711.  
  6712.      
  6713.      
  6714.      usage example:  compiled/executed/verified on 12/15/92
  6715.      
  6716.                      char Astring[80] = "123  af69";
  6717.                      printf("\n%s", ptrnextdig(Astring));
  6718.                      printf("\n%s", ptrnextdig(Astring + 3));
  6719.      
  6720.                      23  af69
  6721.                      69
  6722.      
  6723.                               ┌───────────────────────┐
  6724.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  6725.                               └───────────────────────┘                      */
  6726.  
  6727.  
  6728.  
  6729.  
  6730.  
  6731.  
  6732.  
  6733.  
  6734.  
  6735.  
  6736.  
  6737.  
  6738.  
  6739.  
  6740.  
  6741.  
  6742.  
  6743.  
  6744.  
  6745.  
  6746.  
  6747.  
  6748.  
  6749.  
  6750.  
  6751.  
  6752.  
  6753.  
  6754.  
  6755.  
  6756.  
  6757.  
  6758.  
  6759.  
  6760.  
  6761.  
  6762.  
  6763.  
  6764.  
  6765.  
  6766.      page 104            The Hobbit House String Library
  6767.  
  6768.  
  6769.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6770.      ║ NEXTNODG.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTNODG.C   ║
  6771.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6772.  
  6773.      /*                       ┌───────────────────────┐              ptrnextdig
  6774.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  6775.                               └───────────────────────┘
  6776.                                copyright(c) 1992, 1993
  6777.      
  6778.      function:       ptrnextdig (get PoinTeR to NEXT decimal DIGit in a string)
  6779.      
  6780.      KWIC:           get the pointer to the %next %decimal digit in a string
  6781.      
  6782.      syntax:         #include "hhstring.h"
  6783.                      char *ptrnextdig(char *ptr)
  6784.      
  6785.      description:    this function returns a pointer to the first decimal
  6786.                      digit in memory following the given pointer. if the
  6787.                      pointer points at a decimal digit, that will NOT be the
  6788.                      one pointed to upon return.
  6789.      
  6790.      returns:        a pointer to the next decimal digit, or a NULL if none are
  6791.                      found
  6792.      
  6793.      comments:       like most of the ptrnext<...> functions, this one is a
  6794.                      macro which uses the corresponding ptrfirst<...>
  6795.                      function. The ptrnext<...> functions are maintained
  6796.                      primarily for the sake of consistency among the names
  6797.                      in HHSTRING. Also, the self-documented feature of the name
  6798.                      seems to us to outweigh the apparent ridiculousness of
  6799.                      maintaining a large group of macros which do nothing
  6800.                      more than add one to a pointer in a call to an existing
  6801.                      function.
  6802.      
  6803.      keywords:       pointer, next, decimal, digit
  6804.      
  6805.      key sentence:   gets the pointer to the next decimal digit in a string
  6806.      
  6807.      see also:       ptr< first | last | next | prev >{not}dig
  6808.                      ptr< first | last | next | prev >{not}hex
  6809.      
  6810.  
  6811.  
  6812.  
  6813.  
  6814.  
  6815.  
  6816.  
  6817.  
  6818.  
  6819.  
  6820.  
  6821.  
  6822.  
  6823.  
  6824.  
  6825.  
  6826.  
  6827.                          The Hobbit House String Library               page 105
  6828.  
  6829.  
  6830.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6831.      ║ NEXTNODG.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTNODG.C   ║
  6832.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6833.  
  6834.      
  6835.      
  6836.      usage example:  compiled/executed/verified on 1/7/93
  6837.      
  6838.                      char Astring[80] = "123.45678";
  6839.                      printf("\n%s", ptrnextnotdig(Astring));
  6840.                      printf("\n%s", ptrnextnotdig(Astring + 5));
  6841.      
  6842.                      .45678
  6843.                      (null)
  6844.      
  6845.                               ┌───────────────────────┐
  6846.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  6847.                               └───────────────────────┘                      */
  6848.  
  6849.  
  6850.  
  6851.  
  6852.  
  6853.  
  6854.  
  6855.  
  6856.  
  6857.  
  6858.  
  6859.  
  6860.  
  6861.  
  6862.  
  6863.  
  6864.  
  6865.  
  6866.  
  6867.  
  6868.  
  6869.  
  6870.  
  6871.  
  6872.  
  6873.  
  6874.  
  6875.  
  6876.  
  6877.  
  6878.  
  6879.  
  6880.  
  6881.  
  6882.  
  6883.  
  6884.  
  6885.  
  6886.  
  6887.  
  6888.      page 106            The Hobbit House String Library
  6889.  
  6890.  
  6891.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6892.      ║ NEXTGR.C     ║   file date: 03/13/93    page   1 of   2 ║ NEXTGR.C     ║
  6893.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6894.  
  6895.      /*                       ┌───────────────────────┐               ptrnextgr
  6896.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  6897.                               └───────────────────────┘
  6898.                                copyright(c) 1992, 1993
  6899.      
  6900.      function:       ptrnextgr (get PoinTeR to NEXT occurrence of any character
  6901.                                  from a GRoup of characters)
  6902.      
  6903.      KWIC:           get the pointer to the %next occurrence of any character
  6904.                      from a %group of characters
  6905.      
  6906.      syntax:         #include "hhstring.h"
  6907.                      char *ptrnextgr(char *string, char *chars)
  6908.      
  6909.      description:    string is scanned for the occurrence of any character in
  6910.                      the chars string
  6911.      
  6912.      returns:        a pointer to the character found, or NULL if none
  6913.                      are found
  6914.      
  6915.      comments:       like most of the ptrnext<...> functions, this one is a
  6916.                      macro which uses the corresponding ptrfirst<...>
  6917.                      function. The ptrnext<...> functions are maintained
  6918.                      primarily for the sake of consistency among the names
  6919.                      in HHSTRING. Also, the self-documented feature of the name
  6920.                      seems to us to outweigh the apparent ridiculousness of
  6921.                      maintaining a large group of macros which do nothing
  6922.                      more than add one to a pointer in a call to an existing
  6923.                      function.
  6924.      
  6925.      keywords:       pointer, next, character, group
  6926.      
  6927.      key sentence:   gets the pointer to the next character in a string which
  6928.                      is any one of a group of characters
  6929.      
  6930.      see also:       ptr< first | last | next | prev >{not}range
  6931.                      ptr< first | last | next | prev >{not}group
  6932.      
  6933.  
  6934.  
  6935.  
  6936.  
  6937.  
  6938.  
  6939.  
  6940.  
  6941.  
  6942.  
  6943.  
  6944.  
  6945.  
  6946.  
  6947.  
  6948.  
  6949.                          The Hobbit House String Library               page 107
  6950.  
  6951.  
  6952.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  6953.      ║ NEXTGR.C     ║   file date: 03/13/93    page   2 of   2 ║ NEXTGR.C     ║
  6954.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  6955.  
  6956.      
  6957.      
  6958.      usage example:  compiled/executed/verified on 2/4/93
  6959.      
  6960.                      char *Astring = "This is it: the Sample string";
  6961.                      printf("\n%s", ptrnextgr(Astring, ".,;:!?"));
  6962.                      printf("\n%s", ptrnextgr(Astring, "+-=()"));
  6963.      
  6964.                      : the Sample string
  6965.                      (null)
  6966.      
  6967.                               ┌───────────────────────┐
  6968.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  6969.                               └───────────────────────┘                      */
  6970.  
  6971.  
  6972.  
  6973.  
  6974.  
  6975.  
  6976.  
  6977.  
  6978.  
  6979.  
  6980.  
  6981.  
  6982.  
  6983.  
  6984.  
  6985.  
  6986.  
  6987.  
  6988.  
  6989.  
  6990.  
  6991.  
  6992.  
  6993.  
  6994.  
  6995.  
  6996.  
  6997.  
  6998.  
  6999.  
  7000.  
  7001.  
  7002.  
  7003.  
  7004.  
  7005.  
  7006.  
  7007.  
  7008.  
  7009.  
  7010.      page 108            The Hobbit House String Library
  7011.  
  7012.  
  7013.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7014.      ║ NEXTHEX.C    ║   file date: 03/13/93    page   1 of   2 ║ NEXTHEX.C    ║
  7015.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7016.  
  7017.      /*                       ┌───────────────────────┐              ptrnexthex
  7018.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  7019.                               └───────────────────────┘
  7020.                                copyright(c) 1992, 1993
  7021.      
  7022.      function:       ptrnexthex (get PoinTeR to NEXT HEX digit in string)
  7023.      
  7024.      KWIC:           get the pointer to the %next %hex digit in a string
  7025.      
  7026.      syntax:         #include "hhstring.h"
  7027.                      char *ptrnexthex(char *ptr)
  7028.      
  7029.      description:    this function returns a pointer to the first hex digit
  7030.                      in memory following the given pointer. if the pointer
  7031.                      points at a hex digit, that will NOT be the one pointed
  7032.                      to upon return.
  7033.      
  7034.      returns:        a pointer to the next hex digit
  7035.      
  7036.      comments:       like most of the ptrnext<...> functions, this one is a
  7037.                      macro which uses the corresponding ptrfirst<...>
  7038.                      function. The ptrnext<...> functions are maintained
  7039.                      primarily for the sake of consistency among the names
  7040.                      in HHSTRING. Also, the self-documented feature of the name
  7041.                      seems to us to outweigh the apparent ridiculousness of
  7042.                      maintaining a large group of macros which do nothing
  7043.                      more than add one to a pointer in a call to an existing
  7044.                      function.
  7045.      
  7046.      keywords:       pointer, next, hex, digit
  7047.      
  7048.      key sentence:   gets the pointer to the next hex digit in a string
  7049.      
  7050.      see also:       ptr< first | last | next | prev >{not}dig
  7051.                      ptr< first | last | next | prev >{not}hex
  7052.      
  7053.  
  7054.  
  7055.  
  7056.  
  7057.  
  7058.  
  7059.  
  7060.  
  7061.  
  7062.  
  7063.  
  7064.  
  7065.  
  7066.  
  7067.  
  7068.  
  7069.  
  7070.  
  7071.                          The Hobbit House String Library               page 109
  7072.  
  7073.  
  7074.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7075.      ║ NEXTHEX.C    ║   file date: 03/13/93    page   2 of   2 ║ NEXTHEX.C    ║
  7076.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7077.  
  7078.      
  7079.      
  7080.      usage example:  compiled/executed/verified on 12/15/92
  7081.      
  7082.                      char Astring[80] = "123  af69";
  7083.                      printf("\n%s", ptrnexthex(Astring + 3));
  7084.                      printf("\n%s", ptrnexthex(Astring + 5));
  7085.      
  7086.                      af69
  7087.                      f69
  7088.      
  7089.                               ┌───────────────────────┐
  7090.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  7091.                               └───────────────────────┘                      */
  7092.  
  7093.  
  7094.  
  7095.  
  7096.  
  7097.  
  7098.  
  7099.  
  7100.  
  7101.  
  7102.  
  7103.  
  7104.  
  7105.  
  7106.  
  7107.  
  7108.  
  7109.  
  7110.  
  7111.  
  7112.  
  7113.  
  7114.  
  7115.  
  7116.  
  7117.  
  7118.  
  7119.  
  7120.  
  7121.  
  7122.  
  7123.  
  7124.  
  7125.  
  7126.  
  7127.  
  7128.  
  7129.  
  7130.  
  7131.  
  7132.      page 110            The Hobbit House String Library
  7133.  
  7134.  
  7135.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7136.      ║ NEXTNOBK.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTNOBK.C   ║
  7137.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7138.  
  7139.      /*                       ┌───────────────────────┐         ptrnextnotblank
  7140.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  7141.                               └───────────────────────┘
  7142.                                copyright(c) 1992, 1993
  7143.      
  7144.      function:       ptrnextnotblank (get PoinTeR to NEXT NOT-BLANK)
  7145.      
  7146.      KWIC:           get the pointer to the %next %non-blank in a string
  7147.      
  7148.      syntax:         #include "hhstring.h"
  7149.                      char *ptrnextnotblank(char *stringptr)
  7150.      
  7151.      description:    this function returns a pointer to the next non-blank
  7152.                      in the input string following the character that is
  7153.                      pointed to by the input pointer. If only blanks are
  7154.                      found to the end of the string, then a NULL is returned.
  7155.      
  7156.      returns:        a pointer to the next non-blank or a NULL if only
  7157.                      blanks are found
  7158.      
  7159.      comments:       like most of the ptrnext<...> functions, this one is a
  7160.                      macro which uses the corresponding ptrfirst<...>
  7161.                      function. The ptrnext<...> functions are maintained
  7162.                      primarily for the sake of consistency among the names
  7163.                      in HHSTRING. Also, the self-documented feature of the name
  7164.                      seems to us to outweigh the apparent ridiculousness of
  7165.                      maintaining a large group of macros which do nothing
  7166.                      more than add one to a pointer in a call to an existing
  7167.                      function.
  7168.      
  7169.      keywords:       pointer, next, not, blank
  7170.      
  7171.      key sentence:   gets the pointer to the next non-blank character in a
  7172.                      string
  7173.      
  7174.      see also:       ptr< first | last | next | prev >{not}blank
  7175.                      ptr< first | last | next | prev >{not}white
  7176.      
  7177.  
  7178.  
  7179.  
  7180.  
  7181.  
  7182.  
  7183.  
  7184.  
  7185.  
  7186.  
  7187.  
  7188.  
  7189.  
  7190.  
  7191.  
  7192.  
  7193.                          The Hobbit House String Library               page 111
  7194.  
  7195.  
  7196.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7197.      ║ NEXTNOBK.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTNOBK.C   ║
  7198.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7199.  
  7200.      
  7201.      
  7202.      usage example:  compiled/executed/verified on 12/26/92
  7203.      
  7204.                      char *Astring = "  label1      size3";
  7205.                      char *Bstring = "    lab2\t\t  size4";
  7206.                      char *Cstring = "    lab4           ";
  7207.                      printf("\n-->%s<--", ptrnextnotblank(Astring+8));
  7208.                      printf("\n-->%s<--", ptrnextnotblank(Bstring+8));
  7209.                      printf("\n-->%s<--", ptrnextnotblank(Cstring+8));
  7210.      
  7211.                      -->size3<--
  7212.                      -->       size4<--        the blanks are the expanded '\t'
  7213.                      -->(null)<--
  7214.      
  7215.                               ┌───────────────────────┐
  7216.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  7217.                               └───────────────────────┘                      */
  7218.  
  7219.  
  7220.  
  7221.  
  7222.  
  7223.  
  7224.  
  7225.  
  7226.  
  7227.  
  7228.  
  7229.  
  7230.  
  7231.  
  7232.  
  7233.  
  7234.  
  7235.  
  7236.  
  7237.  
  7238.  
  7239.  
  7240.  
  7241.  
  7242.  
  7243.  
  7244.  
  7245.  
  7246.  
  7247.  
  7248.  
  7249.  
  7250.  
  7251.  
  7252.  
  7253.  
  7254.      page 112            The Hobbit House String Library
  7255.  
  7256.  
  7257.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7258.      ║ NEXTNOCH.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTNOCH.C   ║
  7259.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7260.  
  7261.      /*                       ┌───────────────────────┐           ptrnextnotchr
  7262.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  7263.                               └───────────────────────┘
  7264.                                copyright(c) 1992, 1993
  7265.      
  7266.      function:       ptrnextnotchr (get PoinTeR to NEXT occurrence which is NOT
  7267.                                      a specified CHaRacter)
  7268.      
  7269.      KWIC:           get the pointer to the %next occurrence in a string of a
  7270.                      character which is not the specified %character
  7271.      
  7272.      syntax:         #include "hhstring.h"
  7273.                      char *ptrnextnotchr(char *ptr, char findchar)
  7274.      
  7275.      description:    this function returns a pointer to the next occurrence in
  7276.                      memory of a character which is not the specified
  7277.                      character, starting at the specified pointer. If an EOS
  7278.                      is encountered before any occurrence of the non-character,
  7279.                      then the return pointer will be NULL.
  7280.      
  7281.      returns:        a pointer to the next occurrence of the non-character,
  7282.                      or NULL if the character always occurs
  7283.      
  7284.      comments:       like most of the ptrnext<...> functions, this one is a
  7285.                      macro which uses the corresponding ptrfirst<...>
  7286.                      function. The ptrnext<...> functions are maintained
  7287.                      primarily for the sake of consistency among the names
  7288.                      in HHSTRING. Also, the self-documented feature of the name
  7289.                      seems to us to outweigh the apparent ridiculousness of
  7290.                      maintaining a large group of macros which do nothing
  7291.                      more than add one to a pointer in a call to an existing
  7292.                      function.
  7293.      
  7294.      keywords:       pointer, next, character, not
  7295.      
  7296.      key sentence:   gets the pointer to the next occurrence in a string of any
  7297.                      character which is not the specified character         
  7298.      
  7299.      see also:       ptr< first | last | next | prev >{not}chr{i}
  7300.      
  7301.  
  7302.  
  7303.  
  7304.  
  7305.  
  7306.  
  7307.  
  7308.  
  7309.  
  7310.  
  7311.  
  7312.  
  7313.  
  7314.  
  7315.                          The Hobbit House String Library               page 113
  7316.  
  7317.  
  7318.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7319.      ║ NEXTNOCH.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTNOCH.C   ║
  7320.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7321.  
  7322.      
  7323.      
  7324.      usage example:  compiled/executed/verified on 12/21/92
  7325.      
  7326.                      char Astring[80] = "aaaAaAbbb";
  7327.                      printf("%s", ptrnextnotchr(Astring, 'a'));
  7328.      
  7329.                      AaAbbb
  7330.      
  7331.                               ┌───────────────────────┐
  7332.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  7333.                               └───────────────────────┘                      */
  7334.  
  7335.  
  7336.  
  7337.  
  7338.  
  7339.  
  7340.  
  7341.  
  7342.  
  7343.  
  7344.  
  7345.  
  7346.  
  7347.  
  7348.  
  7349.  
  7350.  
  7351.  
  7352.  
  7353.  
  7354.  
  7355.  
  7356.  
  7357.  
  7358.  
  7359.  
  7360.  
  7361.  
  7362.  
  7363.  
  7364.  
  7365.  
  7366.  
  7367.  
  7368.  
  7369.  
  7370.  
  7371.  
  7372.  
  7373.  
  7374.  
  7375.  
  7376.      page 114            The Hobbit House String Library
  7377.  
  7378.  
  7379.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7380.      ║ NEXTNOCI.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTNOCI.C   ║
  7381.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7382.  
  7383.      /*                       ┌───────────────────────┐          ptrnextnotchri
  7384.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  7385.                               └───────────────────────┘
  7386.                                copyright(c) 1992, 1993
  7387.      
  7388.      function:       ptrnextnotchri (get PoinTeR to NEXT occurrence which is
  7389.                                                                             NOT
  7390.                                      a specified CHaRacter, case-Independant)
  7391.      
  7392.      KWIC:           get the pointer to the %next occurrence in a string of a
  7393.                      character which is not the specified %character,
  7394.                      %independent of case
  7395.      
  7396.      syntax:         #include "hhstring.h"
  7397.                      char *ptrnextnotchri(char *ptr, char findchar)
  7398.      
  7399.      description:    this function returns a pointer to the next occurrence in
  7400.                      memory of a character which is not the specified
  7401.                      character, independent of case, starting at the specified
  7402.                      pointer. If an EOS is encountered before any occurrence of
  7403.                      the non-character, then the return pointer will be NULL.
  7404.      
  7405.      returns:        a pointer to the next occurrence of the non-character,
  7406.                      independent of case (NULL if the character always occurs)
  7407.      
  7408.      comments:       like most of the ptrnext<...> functions, this one is a
  7409.                      macro which uses the corresponding ptrfirst<...>
  7410.                      function. The ptrnext<...> functions are maintained
  7411.                      primarily for the sake of consistency among the names
  7412.                      in HHSTRING. Also, the self-documented feature of the name
  7413.                      seems to us to outweigh the apparent ridiculousness of
  7414.                      maintaining a large group of macros which do nothing
  7415.                      more than add one to a pointer in a call to an existing
  7416.                      function.
  7417.      
  7418.      keywords:       pointer, next, character, not, case-independent
  7419.      
  7420.      key sentence:   gets the pointer to the next occurrence in a string of any
  7421.                      character which is not the specified character,
  7422.                      independent of case
  7423.                           
  7424.      see also:       ptr< first | last | next | prev >{not}chr{i}
  7425.      
  7426.  
  7427.  
  7428.  
  7429.  
  7430.  
  7431.  
  7432.  
  7433.  
  7434.  
  7435.  
  7436.  
  7437.                          The Hobbit House String Library               page 115
  7438.  
  7439.  
  7440.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7441.      ║ NEXTNOCI.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTNOCI.C   ║
  7442.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7443.  
  7444.      
  7445.      
  7446.      usage example:  compiled/executed/verified on 12/21/92
  7447.      
  7448.                      char Astring[80] = "aAaAaAbbb";
  7449.                      printf("%s", ptrnextnotchri(Astring, 'a'));
  7450.      
  7451.                      bbb
  7452.      
  7453.                               ┌───────────────────────┐
  7454.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  7455.                               └───────────────────────┘                      */
  7456.  
  7457.  
  7458.  
  7459.  
  7460.  
  7461.  
  7462.  
  7463.  
  7464.  
  7465.  
  7466.  
  7467.  
  7468.  
  7469.  
  7470.  
  7471.  
  7472.  
  7473.  
  7474.  
  7475.  
  7476.  
  7477.  
  7478.  
  7479.  
  7480.  
  7481.  
  7482.  
  7483.  
  7484.  
  7485.  
  7486.  
  7487.  
  7488.  
  7489.  
  7490.  
  7491.  
  7492.  
  7493.  
  7494.  
  7495.  
  7496.  
  7497.  
  7498.      page 116            The Hobbit House String Library
  7499.  
  7500.  
  7501.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7502.      ║ NEXTNOGR.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTNOGR.C   ║
  7503.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7504.  
  7505.      /*                       ┌───────────────────────┐            ptrnextnotgr
  7506.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  7507.                               └───────────────────────┘
  7508.                                copyright(c) 1992, 1993
  7509.      
  7510.      function:       ptrnextnotgr (get PoinTeR to NEXT occurrence of any
  7511.                                     character NOT in a GRoup of characters)
  7512.      
  7513.      KWIC:           get the pointer to the %next occurrence of any character
  7514.                      NOT in a %group of characters
  7515.      
  7516.      syntax:         #include "hhstring.h"
  7517.                      char *ptrnextnotgr(char *string, char *chars)
  7518.      
  7519.      
  7520.      description:    string is scanned for the occurrence of any character
  7521.                      which is NOT in the chars string
  7522.      
  7523.      returns:        a pointer to the character found, or NULL if none
  7524.                      are found
  7525.      
  7526.      comments:       like most of the ptrnext<...> functions, this one is a
  7527.                      macro which uses the corresponding ptrfirst<...>
  7528.                      function. The ptrnext<...> functions are maintained
  7529.                      primarily for the sake of consistency among the names
  7530.                      in HHSTRING. Also, the self-documented feature of the name
  7531.                      seems to us to outweigh the apparent ridiculousness of
  7532.                      maintaining a large group of macros which do nothing
  7533.                      more than add one to a pointer in a call to an existing
  7534.                      function.
  7535.      
  7536.      
  7537.      keywords:       pointer, next, character, group, not
  7538.      
  7539.      key sentence:   gets the pointer to the first occurrence in a string of
  7540.                                                                             any
  7541.                      character which is not in a given group of characters
  7542.      
  7543.      see also:       ptr< first | last | next | prev >{not}range
  7544.                      ptr< first | last | next | prev >{not}gr
  7545.      
  7546.  
  7547.  
  7548.  
  7549.  
  7550.  
  7551.  
  7552.  
  7553.  
  7554.  
  7555.  
  7556.  
  7557.  
  7558.  
  7559.                          The Hobbit House String Library               page 117
  7560.  
  7561.  
  7562.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7563.      ║ NEXTNOGR.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTNOGR.C   ║
  7564.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7565.  
  7566.      
  7567.      
  7568.      usage example:  compiled/executed/verified on 2/4/93
  7569.      
  7570.                      char *Astring = "0013.58  0014.21 and so on";
  7571.                      printf("\n%s", ptrnextnotgr(Astring, "0123456789 ."));
  7572.                      printf("\n%s", ptrnextnotgr("12345", "0123456789 ."));
  7573.      
  7574.                      and so on
  7575.                      (null)
  7576.      
  7577.                               ┌───────────────────────┐
  7578.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  7579.                               └───────────────────────┘                      */
  7580.  
  7581.  
  7582.  
  7583.  
  7584.  
  7585.  
  7586.  
  7587.  
  7588.  
  7589.  
  7590.  
  7591.  
  7592.  
  7593.  
  7594.  
  7595.  
  7596.  
  7597.  
  7598.  
  7599.  
  7600.  
  7601.  
  7602.  
  7603.  
  7604.  
  7605.  
  7606.  
  7607.  
  7608.  
  7609.  
  7610.  
  7611.  
  7612.  
  7613.  
  7614.  
  7615.  
  7616.  
  7617.  
  7618.  
  7619.  
  7620.      page 118            The Hobbit House String Library
  7621.  
  7622.  
  7623.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7624.      ║ NEXTNOHX.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTNOHX.C   ║
  7625.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7626.  
  7627.      /*                       ┌───────────────────────┐           ptrnextnothex
  7628.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  7629.                               └───────────────────────┘
  7630.                                copyright(c) 1992, 1993
  7631.      
  7632.      function:       ptrnextnothex (get PoinTeR to NEXT character which is NOT
  7633.                      a HEX digit in string)
  7634.      
  7635.      KWIC:           get the pointer to the %next %non-hex-digit in a string
  7636.      
  7637.      syntax:         #include "hhstring.h"
  7638.                      char *ptrnextnothex(char *ptr)
  7639.      
  7640.      description:    this function returns a pointer to the first character in
  7641.                      memory, following the given pointer, which is not a hex
  7642.                      digit. if the pointer points at a hex digit, that will NOT
  7643.                      be the one pointed to upon return.
  7644.      
  7645.      returns:        a pointer to the next hex digit
  7646.      
  7647.      comments:       like most of the ptrnext<...> functions, this one is a
  7648.                      macro which uses the corresponding ptrfirst<...>
  7649.                      function. The ptrnext<...> functions are maintained
  7650.                      primarily for the sake of consistency among the names
  7651.                      in HHSTRING. Also, the self-documented feature of the name
  7652.                      seems to us to outweigh the apparent ridiculousness of
  7653.                      maintaining a large group of macros which do nothing
  7654.                      more than add one to a pointer in a call to an existing
  7655.                      function.
  7656.      
  7657.      keywords:       pointer, next, hex, digit, not
  7658.      
  7659.      key sentence:   gets the pointer to the next non-hex-digit in a string
  7660.      
  7661.      key sentence:   gets the pointer to the next character in a string which
  7662.                      is not a hex digit
  7663.      
  7664.      see also:       ptr< first | last | next | prev >{not}dig
  7665.                      ptr< first | last | next | prev >{not}hex
  7666.      
  7667.  
  7668.  
  7669.  
  7670.  
  7671.  
  7672.  
  7673.  
  7674.  
  7675.  
  7676.  
  7677.  
  7678.  
  7679.  
  7680.  
  7681.                          The Hobbit House String Library               page 119
  7682.  
  7683.  
  7684.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7685.      ║ NEXTNOHX.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTNOHX.C   ║
  7686.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7687.  
  7688.      
  7689.      
  7690.      usage example:  compiled/executed/verified on 1/7/93
  7691.      
  7692.                      char Astring[80] = "123af69 is the answer";
  7693.                      printf("\n%s", ptrnextnothex(Astring));
  7694.      
  7695.                       is the answer
  7696.      
  7697.                               ┌───────────────────────┐
  7698.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  7699.                               └───────────────────────┘                      */
  7700.  
  7701.  
  7702.  
  7703.  
  7704.  
  7705.  
  7706.  
  7707.  
  7708.  
  7709.  
  7710.  
  7711.  
  7712.  
  7713.  
  7714.  
  7715.  
  7716.  
  7717.  
  7718.  
  7719.  
  7720.  
  7721.  
  7722.  
  7723.  
  7724.  
  7725.  
  7726.  
  7727.  
  7728.  
  7729.  
  7730.  
  7731.  
  7732.  
  7733.  
  7734.  
  7735.  
  7736.  
  7737.  
  7738.  
  7739.  
  7740.  
  7741.  
  7742.      page 120            The Hobbit House String Library
  7743.  
  7744.  
  7745.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7746.      ║ NEXTNORN.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTNORN.C   ║
  7747.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7748.  
  7749.      /*                       ┌───────────────────────┐         ptrnextnotrange
  7750.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  7751.                               └───────────────────────┘
  7752.                                copyright(c) 1992, 1993
  7753.      
  7754.      function:       ptrnextnotrange (get PoinTeR, NEXT, NOT in RANGE)
  7755.      
  7756.      KWIC:           get the pointer to the %next occurrence in a string of any
  7757.                      character NOT in a %range of characters
  7758.      
  7759.      syntax:         #include "hhstring.h"
  7760.                      char *ptrnextnotrange(char *instring, char c1, char c2)
  7761.      
  7762.      description:    instring is scanned for the occurrence of any character
  7763.                      which is NOT in the range c1 to c2 inclusive
  7764.      
  7765.      returns:        a pointer to the character found, or a NULL if none
  7766.                      are found
  7767.      
  7768.      comments:       like most of the ptrnext<...> functions, this one is a
  7769.                      macro which uses the corresponding ptrfirst<...>
  7770.                      function. The ptrnext<...> functions are maintained
  7771.                      primarily for the sake of consistency among the names
  7772.                      in HHSTRING. Also, the self-documented feature of the name
  7773.                      seems to us to outweigh the apparent ridiculousness of
  7774.                      maintaining a large group of macros which do nothing
  7775.                      more than add one to a pointer in a call to an existing
  7776.                      function.
  7777.      
  7778.      
  7779.      keywords:       pointer, next, not, character, range
  7780.      
  7781.      key sentence:   gets the pointer to the next occurrence in a string of any
  7782.                      character NOT in a range of characters
  7783.      
  7784.      see also:       ptr< first | last | next | prev >{not}range
  7785.                      ptr< first | last | next | prev >{not}set
  7786.      
  7787.  
  7788.  
  7789.  
  7790.  
  7791.  
  7792.  
  7793.  
  7794.  
  7795.  
  7796.  
  7797.  
  7798.  
  7799.  
  7800.  
  7801.  
  7802.  
  7803.                          The Hobbit House String Library               page 121
  7804.  
  7805.  
  7806.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7807.      ║ NEXTNORN.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTNORN.C   ║
  7808.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7809.  
  7810.      
  7811.      
  7812.      usage example:  compiled/executed/verified on 1/7/93
  7813.      
  7814.                      char *Astring = "This is it: {the Sample string}";
  7815.                      printf("\n%s", ptrnextnotrange(Astring, ' ', 'z'));
  7816.                      printf("\n%s", ptrnextnotrange(Astring, ' ', '}'));
  7817.      
  7818.                      {the Sample string}
  7819.                      (null)
  7820.      
  7821.                               ┌───────────────────────┐
  7822.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  7823.                               └───────────────────────┘                      */
  7824.  
  7825.  
  7826.  
  7827.  
  7828.  
  7829.  
  7830.  
  7831.  
  7832.  
  7833.  
  7834.  
  7835.  
  7836.  
  7837.  
  7838.  
  7839.  
  7840.  
  7841.  
  7842.  
  7843.  
  7844.  
  7845.  
  7846.  
  7847.  
  7848.  
  7849.  
  7850.  
  7851.  
  7852.  
  7853.  
  7854.  
  7855.  
  7856.  
  7857.  
  7858.  
  7859.  
  7860.  
  7861.  
  7862.  
  7863.  
  7864.      page 122            The Hobbit House String Library
  7865.  
  7866.  
  7867.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7868.      ║ NEXTNOTT.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTNOTT.C   ║
  7869.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7870.  
  7871.      /*                       ┌───────────────────────┐      ptrnextnottextterm
  7872.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  7873.                               └───────────────────────┘
  7874.                                copyright(c) 1992, 1993
  7875.      
  7876.      function:       ptrnextnottextterm (get PoinTeR to NEXT NOT-TEXT-
  7877.                                          TERMinator)
  7878.      
  7879.      KWIC:           get the pointer to the %next %non-text-terminator in a
  7880.                      string
  7881.      
  7882.      syntax:         #include "hhstring.h"
  7883.                      char *ptrnextnottextterm(char *stringptr)
  7884.      
  7885.      description:    this function returns a pointer to the next non-text
  7886.                      terminator in the input string following the character
  7887.                      that is pointed to by the input pointer. If only text
  7888.                      terminators are found to the end of the string, then a
  7889.                      NULL is returned.
  7890.      
  7891.      returns:        a pointer to the next non-text-terminator or a NULL if
  7892.                      only text terminators are found
  7893.      
  7894.      comments:       like most of the ptrnext<...> functions, this one is a
  7895.                      macro which uses the corresponding ptrfirst<...>
  7896.                      function. The ptrnext<...> functions are maintained
  7897.                      primarily for the sake of consistency among the names
  7898.                      in HHSTRING. Also, the self-documented feature of the name
  7899.                      seems to us to outweigh the apparent ridiculousness of
  7900.                      maintaining a large group of macros which do nothing
  7901.                      more than add one to a pointer in a call to an existing
  7902.                      function.
  7903.      
  7904.      keywords:       pointer, next, not, text, terminator
  7905.      
  7906.      key sentence:   gets the pointer to the next non-text-terminator
  7907.                      character in a string
  7908.      
  7909.      see also:       ptr< first | last | next | prev >nottextterm
  7910.      
  7911.  
  7912.  
  7913.  
  7914.  
  7915.  
  7916.  
  7917.  
  7918.  
  7919.  
  7920.  
  7921.  
  7922.  
  7923.  
  7924.  
  7925.                          The Hobbit House String Library               page 123
  7926.  
  7927.  
  7928.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7929.      ║ NEXTNOTT.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTNOTT.C   ║
  7930.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7931.  
  7932.      
  7933.      
  7934.      usage example:  compiled/executed/verified on 1/31/93
  7935.      
  7936.                      char *Astring = "  label1      size3";
  7937.                      char *Bstring = "    lab2\t\t  size4";
  7938.                      char *Cstring = "    lab4  .  ? ! ";
  7939.                      printf("\n%s", ptrnextnottextterm(Astring+8));
  7940.                      printf("\n%s", ptrnextnottextterm(Bstring+8));
  7941.                      printf("\n%s", ptrnextnottextterm(Cstring+8));
  7942.      
  7943.                      size3
  7944.                      size4
  7945.                      (null)
  7946.      
  7947.                               ┌───────────────────────┐
  7948.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  7949.                               └───────────────────────┘                      */
  7950.  
  7951.  
  7952.  
  7953.  
  7954.  
  7955.  
  7956.  
  7957.  
  7958.  
  7959.  
  7960.  
  7961.  
  7962.  
  7963.  
  7964.  
  7965.  
  7966.  
  7967.  
  7968.  
  7969.  
  7970.  
  7971.  
  7972.  
  7973.  
  7974.  
  7975.  
  7976.  
  7977.  
  7978.  
  7979.  
  7980.  
  7981.  
  7982.  
  7983.  
  7984.  
  7985.  
  7986.      page 124            The Hobbit House String Library
  7987.  
  7988.  
  7989.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  7990.      ║ NEXTNOWH.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTNOWH.C   ║
  7991.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  7992.  
  7993.      /*                       ┌───────────────────────┐         ptrnextnotwhite
  7994.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  7995.                               └───────────────────────┘
  7996.                                copyright(c) 1992, 1993
  7997.      
  7998.      function:       ptrnextnotwhite (get PoinTeR to NEXT NOT-WHITE)
  7999.      
  8000.      KWIC:           get the pointer to the %next %non-whitespace in a string
  8001.      
  8002.      syntax:         #include "hhstring.h"
  8003.                      char *ptrnextnotwhite(char *stringptr)
  8004.      
  8005.      description:    this function returns a pointer to the next "non-white
  8006.                      char" (anything other than a blank or a tab) in the input
  8007.                      string following the character that is pointed to by the
  8008.                      input pointer. If only whitespace characters are found to
  8009.                      the end of the string, then a NULL is returned.
  8010.      
  8011.      returns:        a pointer to the next "non-white char" or a NULL if only
  8012.                      whitespace characters are found
  8013.      
  8014.      comments:       like most of the ptrnext<...> functions, this one is a
  8015.                      macro which uses the corresponding ptrfirst<...>
  8016.                      function. The ptrnext<...> functions are maintained
  8017.                      primarily for the sake of consistency among the names
  8018.                      in HHSTRING. Also, the self-documented feature of the name
  8019.                      seems to us to outweigh the apparent ridiculousness of
  8020.                      maintaining a large group of macros which do nothing
  8021.                      more than add one to a pointer in a call to an existing
  8022.                      function.
  8023.      
  8024.      keywords:       pointer, next, character, not, whitespace, blank, tab
  8025.      
  8026.      key sentence:   gets the pointer to the next non-whitespace character
  8027.                      in a string
  8028.      
  8029.      see also:       ptr< first | last | next | prev >{not}blank
  8030.                      ptr< first | last | next | prev >{not}white
  8031.      
  8032.  
  8033.  
  8034.  
  8035.  
  8036.  
  8037.  
  8038.  
  8039.  
  8040.  
  8041.  
  8042.  
  8043.  
  8044.  
  8045.  
  8046.  
  8047.                          The Hobbit House String Library               page 125
  8048.  
  8049.  
  8050.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8051.      ║ NEXTNOWH.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTNOWH.C   ║
  8052.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8053.  
  8054.      
  8055.      
  8056.      usage example:  compiled/executed/verified on 12/26/92
  8057.      
  8058.                      char *Astring = "  label1      size3";
  8059.                      char *Bstring = "    lab2\t\t  size4";
  8060.                      char *Cstring = "    lab4           ";
  8061.                      printf("\n-->%s<--", ptrnextnotwhite(Astring+9));
  8062.                      printf("\n-->%s<--", ptrnextnotwhite(Bstring+9));
  8063.                      printf("\n-->%s<--", ptrnextnotwhite(Cstring+9));
  8064.      
  8065.                      -->size3<--
  8066.                      -->size4<--
  8067.                      -->(null)<--
  8068.      
  8069.                               ┌───────────────────────┐
  8070.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  8071.                               └───────────────────────┘                      */
  8072.  
  8073.  
  8074.  
  8075.  
  8076.  
  8077.  
  8078.  
  8079.  
  8080.  
  8081.  
  8082.  
  8083.  
  8084.  
  8085.  
  8086.  
  8087.  
  8088.  
  8089.  
  8090.  
  8091.  
  8092.  
  8093.  
  8094.  
  8095.  
  8096.  
  8097.  
  8098.  
  8099.  
  8100.  
  8101.  
  8102.  
  8103.  
  8104.  
  8105.  
  8106.  
  8107.  
  8108.      page 126            The Hobbit House String Library
  8109.  
  8110.  
  8111.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8112.      ║ NEXTNOWT.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTNOWT.C   ║
  8113.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8114.  
  8115.      /*                       ┌───────────────────────┐      ptrnextnotwordterm
  8116.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  8117.                               └───────────────────────┘
  8118.                                copyright(c) 1992, 1993
  8119.      
  8120.      function:       ptrnextnotwordterm (get PoinTeR to NEXT NOT-WORD-
  8121.                                          TERMinator)
  8122.      
  8123.      KWIC:           get the pointer to the %next %non-word-terminator in a
  8124.                      string
  8125.      
  8126.      syntax:         #include "hhstring.h"
  8127.                      char *ptrnextnotwordterm(char *stringptr)
  8128.      
  8129.      description:    this function returns a pointer to the next non-word
  8130.                      terminator in the input string following the character
  8131.                      that is pointed to by the input pointer. If only word
  8132.                      terminators are found to the end of the string, then a
  8133.                      NULL is returned.
  8134.      
  8135.      returns:        a pointer to the next non-word-terminator or a NULL if
  8136.                      only word terminators are found
  8137.      
  8138.      comments:       like most of the ptrnext<...> functions, this one is a
  8139.                      macro which uses the corresponding ptrfirst<...>
  8140.                      function. The ptrnext<...> functions are maintained
  8141.                      primarily for the sake of consistency among the names
  8142.                      in HHSTRING. Also, the self-documented feature of the name
  8143.                      seems to us to outweigh the apparent ridiculousness of
  8144.                      maintaining a large group of macros which do nothing
  8145.                      more than add one to a pointer in a call to an existing
  8146.                      function.
  8147.      
  8148.      keywords:       pointer, next, not, word, terminator
  8149.      
  8150.      key sentence:   gets the pointer to the next non-word-terminator
  8151.                      character in a string
  8152.      
  8153.      see also:       ptr< first | last | next | prev >notwordterm
  8154.      
  8155.  
  8156.  
  8157.  
  8158.  
  8159.  
  8160.  
  8161.  
  8162.  
  8163.  
  8164.  
  8165.  
  8166.  
  8167.  
  8168.  
  8169.                          The Hobbit House String Library               page 127
  8170.  
  8171.  
  8172.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8173.      ║ NEXTNOWT.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTNOWT.C   ║
  8174.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8175.  
  8176.      
  8177.      
  8178.      usage example:  compiled/executed/verified on 1/31/93
  8179.      
  8180.                      char *Astring = "  label1      size3";
  8181.                      char *Bstring = "    lab2\t\t  size4";
  8182.                      char *Cstring = "    lab4           ";
  8183.                      printf("\n%s", ptrnextnotwordterm(Astring+8));
  8184.                      printf("\n%s", ptrnextnotwordterm(Bstring+8));
  8185.                      printf("\n%s", ptrnextnotwordterm(Cstring+8));
  8186.      
  8187.                      size3
  8188.                      size4
  8189.                      (null)
  8190.      
  8191.                               ┌───────────────────────┐
  8192.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  8193.                               └───────────────────────┘                      */
  8194.  
  8195.  
  8196.  
  8197.  
  8198.  
  8199.  
  8200.  
  8201.  
  8202.  
  8203.  
  8204.  
  8205.  
  8206.  
  8207.  
  8208.  
  8209.  
  8210.  
  8211.  
  8212.  
  8213.  
  8214.  
  8215.  
  8216.  
  8217.  
  8218.  
  8219.  
  8220.  
  8221.  
  8222.  
  8223.  
  8224.  
  8225.  
  8226.  
  8227.  
  8228.  
  8229.  
  8230.      page 128            The Hobbit House String Library
  8231.  
  8232.  
  8233.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8234.      ║ NEXTRAN.C    ║   file date: 03/13/93    page   1 of   2 ║ NEXTRAN.C    ║
  8235.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8236.  
  8237.      /*                       ┌───────────────────────┐            ptrnextrange
  8238.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  8239.                               └───────────────────────┘
  8240.                                copyright(c) 1992, 1993
  8241.      
  8242.      function:       ptrnextrange (get PoinTeR, NEXT, from RANGE)
  8243.      
  8244.      KWIC:           get the pointer to the %next occurrence in a string of any
  8245.                      character from a %range of characters
  8246.      
  8247.      syntax:         #include "hhstring.h"
  8248.                      char *ptrnextrange(char *instring, char c1, char c2)
  8249.      
  8250.      description:    instring is scanned for the next occurrence of any
  8251.                      character in the range c1 to c2 inclusive
  8252.      
  8253.      returns:        a pointer to the character found, or a NULL if none
  8254.                      are found
  8255.      
  8256.      comments:       like most of the ptrnext<...> functions, this one is a
  8257.                      macro which uses the corresponding ptrfirst<...>
  8258.                      function. The ptrnext<...> functions are maintained
  8259.                      primarily for the sake of consistency among the names
  8260.                      in HHSTRING. Also, the self-documented feature of the name
  8261.                      seems to us to outweigh the apparent ridiculousness of
  8262.                      maintaining a large group of macros which do nothing
  8263.                      more than add one to a pointer in a call to an existing
  8264.                      function.
  8265.      
  8266.      keywords:       pointer, next, character, range
  8267.      
  8268.      key sentence:   gets the pointer to the next occurrence in a string of any
  8269.                      character from a range of characters
  8270.      
  8271.      see also:       ptr< first | last | next | prev >{not}range
  8272.                      ptr< first | last | next | prev >{not}set
  8273.      
  8274.  
  8275.  
  8276.  
  8277.  
  8278.  
  8279.  
  8280.  
  8281.  
  8282.  
  8283.  
  8284.  
  8285.  
  8286.  
  8287.  
  8288.  
  8289.  
  8290.  
  8291.                          The Hobbit House String Library               page 129
  8292.  
  8293.  
  8294.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8295.      ║ NEXTRAN.C    ║   file date: 03/13/93    page   2 of   2 ║ NEXTRAN.C    ║
  8296.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8297.  
  8298.      
  8299.      
  8300.      usage example:  compiled/executed/verified on 12/16/92
  8301.      
  8302.                      char *Astring = "This is it: the Sample string";
  8303.                      printf("\n%s", ptrnextrange(Astring, '!', '?'));
  8304.                      printf("\n%s", ptrnextrange(Astring, '!', '/'));
  8305.      
  8306.                      : the Sample string
  8307.                      (null)
  8308.      
  8309.                               ┌───────────────────────┐
  8310.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  8311.                               └───────────────────────┘                      */
  8312.  
  8313.  
  8314.  
  8315.  
  8316.  
  8317.  
  8318.  
  8319.  
  8320.  
  8321.  
  8322.  
  8323.  
  8324.  
  8325.  
  8326.  
  8327.  
  8328.  
  8329.  
  8330.  
  8331.  
  8332.  
  8333.  
  8334.  
  8335.  
  8336.  
  8337.  
  8338.  
  8339.  
  8340.  
  8341.  
  8342.  
  8343.  
  8344.  
  8345.  
  8346.  
  8347.  
  8348.  
  8349.  
  8350.  
  8351.  
  8352.      page 130            The Hobbit House String Library
  8353.  
  8354.  
  8355.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8356.      ║ NEXTSUB.C    ║   file date: 03/13/93    page   1 of   2 ║ NEXTSUB.C    ║
  8357.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8358.  
  8359.      /*                       ┌───────────────────────┐              ptrnextsub
  8360.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  8361.                               └───────────────────────┘
  8362.                                copyright(c) 1992, 1993
  8363.      
  8364.      function:       ptrnextsub (get PoinTeR to NEXT occurrence of a SUBstring)
  8365.      
  8366.      KWIC:           get the pointer to the %next occurrence of a %substring
  8367.                      in a string
  8368.      
  8369.      syntax:         #include "hhstring.h"
  8370.                      char *ptrnextsub(char *ptr, char *substring)
  8371.      
  8372.      description:    ptr is scanned for the next occurrence of substring
  8373.      
  8374.      returns:        a pointer to the occurrence of substring, or NULL if
  8375.                      the substring does not appear in ptr
  8376.      
  8377.      comments:       like most of the ptrnext<...> functions, this one is a
  8378.                      macro which uses the corresponding ptrfirst<...>
  8379.                      function. The ptrnext<...> functions are maintained
  8380.                      primarily for the sake of consistency among the names
  8381.                      in HHSTRING. Also, the self-documented feature of the name
  8382.                      seems to us to outweigh the apparent ridiculousness of
  8383.                      maintaining a large group of macros which do nothing
  8384.                      more than add one to a pointer in a call to an existing
  8385.                      function.
  8386.      
  8387.      keywords:       pointer, next, substring
  8388.      
  8389.      key sentence:   gets the pointer to the next occurrence of a substring in
  8390.                                                                               a
  8391.                      string
  8392.      
  8393.      see also:       ptr< first | last | next | prev >sub{i}
  8394.      
  8395.  
  8396.  
  8397.  
  8398.  
  8399.  
  8400.  
  8401.  
  8402.  
  8403.  
  8404.  
  8405.  
  8406.  
  8407.  
  8408.  
  8409.  
  8410.  
  8411.  
  8412.  
  8413.                          The Hobbit House String Library               page 131
  8414.  
  8415.  
  8416.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8417.      ║ NEXTSUB.C    ║   file date: 03/13/93    page   2 of   2 ║ NEXTSUB.C    ║
  8418.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8419.  
  8420.      
  8421.      
  8422.      usage example:  compiled/executed/verified on 12/16/92
  8423.      
  8424.                      char *Astring = "This is the Sample string";
  8425.                      printf("%s", ptrnextsub(Astring, "Sample"));
  8426.      
  8427.                      Sample string
  8428.      
  8429.                               ┌───────────────────────┐
  8430.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  8431.                               └───────────────────────┘                      */
  8432.  
  8433.  
  8434.  
  8435.  
  8436.  
  8437.  
  8438.  
  8439.  
  8440.  
  8441.  
  8442.  
  8443.  
  8444.  
  8445.  
  8446.  
  8447.  
  8448.  
  8449.  
  8450.  
  8451.  
  8452.  
  8453.  
  8454.  
  8455.  
  8456.  
  8457.  
  8458.  
  8459.  
  8460.  
  8461.  
  8462.  
  8463.  
  8464.  
  8465.  
  8466.  
  8467.  
  8468.  
  8469.  
  8470.  
  8471.  
  8472.  
  8473.  
  8474.      page 132            The Hobbit House String Library
  8475.  
  8476.  
  8477.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8478.      ║ NEXTSUBI.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTSUBI.C   ║
  8479.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8480.  
  8481.      /*                       ┌───────────────────────┐             ptrnextsubi
  8482.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  8483.                               └───────────────────────┘
  8484.                                copyright(c) 1992, 1993
  8485.      
  8486.      function:       ptrnextsubi (get PoinTeR to NEXT occurrence of a
  8487.                                   SUBstring, Independant of case)
  8488.      
  8489.      KWIC:           get the pointer to the %next occurrence of a %substring,
  8490.                      %independant of case
  8491.      
  8492.      syntax:         #include "hhstring.h"
  8493.                      char *ptrnextsubi(char *inptr, char *substring)
  8494.      
  8495.      description:    inptr is scanned for the next case-independent
  8496.                      occurrence of substring
  8497.      
  8498.      returns:        a pointer to the occurrence of substring, or a NULL if
  8499.                      substring does not occur in inptr
  8500.      
  8501.      comments:       like most of the ptrnext<...> functions, this one is a
  8502.                      macro which uses the corresponding ptrfirst<...>
  8503.                      function. The ptrnext<...> functions are maintained
  8504.                      primarily for the sake of consistency among the names
  8505.                      in HHSTRING. Also, the self-documented feature of the name
  8506.                      seems to us to outweigh the apparent ridiculousness of
  8507.                      maintaining a large group of macros which do nothing
  8508.                      more than add one to a pointer in a call to an existing
  8509.                      function.
  8510.      
  8511.      keywords:       pointer, next, substring, case-independent
  8512.      
  8513.      key sentence:   gets the pointer to the next occurrence, independent of
  8514.                      case, of a substring in a string
  8515.      
  8516.      see also:       ptr< first | last | next | prev >sub{i}
  8517.      
  8518.  
  8519.  
  8520.  
  8521.  
  8522.  
  8523.  
  8524.  
  8525.  
  8526.  
  8527.  
  8528.  
  8529.  
  8530.  
  8531.  
  8532.  
  8533.  
  8534.  
  8535.                          The Hobbit House String Library               page 133
  8536.  
  8537.  
  8538.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8539.      ║ NEXTSUBI.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTSUBI.C   ║
  8540.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8541.  
  8542.      
  8543.      
  8544.      usage example:  compiled/executed/verified on 12/16/92
  8545.      
  8546.                      char *Astring = "This is this Sample string";
  8547.                      printf("\n%s", ptrnextsubi(Astring, "THIS"));
  8548.                      printf("\n%s", ptrnextsubi(Astring, "notpresent"));
  8549.      
  8550.                      this Sample string
  8551.                      (null)
  8552.      
  8553.                               ┌───────────────────────┐
  8554.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  8555.                               └───────────────────────┘                      */
  8556.  
  8557.  
  8558.  
  8559.  
  8560.  
  8561.  
  8562.  
  8563.  
  8564.  
  8565.  
  8566.  
  8567.  
  8568.  
  8569.  
  8570.  
  8571.  
  8572.  
  8573.  
  8574.  
  8575.  
  8576.  
  8577.  
  8578.  
  8579.  
  8580.  
  8581.  
  8582.  
  8583.  
  8584.  
  8585.  
  8586.  
  8587.  
  8588.  
  8589.  
  8590.  
  8591.  
  8592.  
  8593.  
  8594.  
  8595.  
  8596.      page 134            The Hobbit House String Library
  8597.  
  8598.  
  8599.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8600.      ║ NEXTTEXT.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTTEXT.C   ║
  8601.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8602.  
  8603.      /*                       ┌───────────────────────┐             ptrnexttext
  8604.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  8605.                               └───────────────────────┘
  8606.                                copyright(c) 1992, 1993
  8607.      
  8608.      function:       ptrnexttext (get PoinTeR to NEXT TEXT word)
  8609.      
  8610.      KWIC:           get the pointer to the %next %text word in a string
  8611.      
  8612.      syntax:         #include "hhstring.h"
  8613.                      char *ptrnexttext(char *instring)
  8614.      
  8615.      description:    this function returns a pointer to the next text word in
  8616.                      instring. If there is no next word, then a NULL is
  8617.                      returned. The "next text word" means the first non-
  8618.                      terminator character following the first terminator
  8619.                      character following instring. Think about it this way;
  8620.                      from instring, you look for the next terminator and then
  8621.                      from there you look for the next non-terminator. That
  8622.                      way, you get the next word whether instring starts with
  8623.                      a word or not.
  8624.      
  8625.      returns:        a pointer to the next text word
  8626.      
  8627.      comments:       a "text word" is a human language construct as opposed to
  8628.                      a "string word" which is simply a set of characters
  8629.                      surrounded by whitespace. The only distinction made by
  8630.                      this function library is in the terminator. "Words" are
  8631.                      terminated by a blank, a tab, an ASCII End-Of-Line (EOL)
  8632.                      or an End-Of-String (EOS). "Text words", however, may also
  8633.                      be terminated by any of these punctuation marks: .!?:;,
  8634.      
  8635.                      while most of the "ptrnext..." functions are macros
  8636.                      using the corresponding "ptrfirst..." function, that
  8637.                      cannot be done with this function because it is
  8638.                      word-oriented not character-oriented
  8639.      
  8640.      keywords:       pointer, next, word, text
  8641.      
  8642.      key sentence:   gets the pointer to the next text word in a string
  8643.      
  8644.      see also:       ptr< first | last | next | this | prev>text
  8645.      
  8646.  
  8647.  
  8648.  
  8649.  
  8650.  
  8651.  
  8652.  
  8653.  
  8654.  
  8655.  
  8656.  
  8657.                          The Hobbit House String Library               page 135
  8658.  
  8659.  
  8660.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8661.      ║ NEXTTEXT.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTTEXT.C   ║
  8662.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8663.  
  8664.      
  8665.      
  8666.      usage example:  compiled/executed/verified on 1/30/93
  8667.      
  8668.                      char *Astring = "label1    size3";
  8669.                      char *Bstring = "lab2.size4";
  8670.                      char *Cstring = "lab4           ";
  8671.                      printf("\n-->%s<--", ptrnexttext(Astring));
  8672.                      printf("\n-->%s<--", ptrnexttext(Bstring));
  8673.                      printf("\n-->%s<--", ptrnexttext(Cstring+4));
  8674.      
  8675.                      -->size3<--
  8676.                      -->size4<--
  8677.                      -->(null)<--
  8678.      
  8679.                               ┌───────────────────────┐
  8680.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  8681.                               └───────────────────────┘                      */
  8682.  
  8683.  
  8684.  
  8685.  
  8686.  
  8687.  
  8688.  
  8689.  
  8690.  
  8691.  
  8692.  
  8693.  
  8694.  
  8695.  
  8696.  
  8697.  
  8698.  
  8699.  
  8700.  
  8701.  
  8702.  
  8703.  
  8704.  
  8705.  
  8706.  
  8707.  
  8708.  
  8709.  
  8710.  
  8711.  
  8712.  
  8713.  
  8714.  
  8715.  
  8716.  
  8717.  
  8718.      page 136            The Hobbit House String Library
  8719.  
  8720.  
  8721.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8722.      ║ NEXTTXTR.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTTXTR.C   ║
  8723.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8724.  
  8725.      /*                       ┌───────────────────────┐         ptrnexttextterm
  8726.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  8727.                               └───────────────────────┘
  8728.                                copyright(c) 1992, 1993
  8729.      
  8730.      function:       ptrnexttextterm (get PoinTeR to NEXT TEXT word TERMinator)
  8731.      
  8732.      KWIC:           get the pointer to the %next %text word terminator in a
  8733.                      string
  8734.      
  8735.      syntax:         #include "hhstring.h"
  8736.                      char *ptrnexttextterm(char *ptr)
  8737.      
  8738.      description:    this function returns a pointer to the first text word
  8739.                      terminator in memory following the given pointer. if the
  8740.                      pointer points at a text terminator, that will NOT be the
  8741.                      one pointed to upon return.
  8742.      
  8743.      returns:        a pointer to the next text word terminator (since the
  8744.                      string terminator is a legal text word terminator, this
  8745.                      function will never return a but may return a pointer
  8746.                      to the string terminator.
  8747.      
  8748.      comments:       like most of the ptrnext<...> functions, this one is a
  8749.                      macro which uses the corresponding ptrfirst<...>
  8750.                      function. The ptrnext<...> functions are maintained
  8751.                      primarily for the sake of consistency among the names
  8752.                      in HHSTRING. Also, the self-documented feature of the name
  8753.                      seems to us to outweigh the apparent ridiculousness of
  8754.                      maintaining a large group of macros which do nothing
  8755.                      more than add one to a pointer in a call to an existing
  8756.                      function.
  8757.      
  8758.      keywords:       pointer, next, character, text, terminator
  8759.      
  8760.      key sentence:   gets the pointer to the next text word terminator
  8761.                      in a string
  8762.      
  8763.      see also:       ptr< first | last | next | prev >textterm
  8764.      
  8765.  
  8766.  
  8767.  
  8768.  
  8769.  
  8770.  
  8771.  
  8772.  
  8773.  
  8774.  
  8775.  
  8776.  
  8777.  
  8778.  
  8779.                          The Hobbit House String Library               page 137
  8780.  
  8781.  
  8782.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8783.      ║ NEXTTXTR.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTTXTR.C   ║
  8784.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8785.  
  8786.      
  8787.      
  8788.      usage example:  compiled/executed/verified on 1/31/93
  8789.      
  8790.                      char *Astring = "thisis.thesample string";
  8791.                      char *Bstring = "one_in_here.";
  8792.                      printf("\n%s", ptrnexttextterm(Astring));
  8793.                      printf("\n%s", ptrnexttextterm(Bstring));
  8794.      
  8795.                      .the sample string
  8796.                      .
  8797.      
  8798.                               ┌───────────────────────┐
  8799.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  8800.                               └───────────────────────┘                      */
  8801.  
  8802.  
  8803.  
  8804.  
  8805.  
  8806.  
  8807.  
  8808.  
  8809.  
  8810.  
  8811.  
  8812.  
  8813.  
  8814.  
  8815.  
  8816.  
  8817.  
  8818.  
  8819.  
  8820.  
  8821.  
  8822.  
  8823.  
  8824.  
  8825.  
  8826.  
  8827.  
  8828.  
  8829.  
  8830.  
  8831.  
  8832.  
  8833.  
  8834.  
  8835.  
  8836.  
  8837.  
  8838.  
  8839.  
  8840.      page 138            The Hobbit House String Library
  8841.  
  8842.  
  8843.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8844.      ║ NEXTWH.C     ║   file date: 03/13/93    page   1 of   2 ║ NEXTWH.C     ║
  8845.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8846.  
  8847.      /*                       ┌───────────────────────┐            ptrnextwhite
  8848.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  8849.                               └───────────────────────┘
  8850.                                copyright(c) 1992, 1993
  8851.      
  8852.      function:       ptrnextwhite (get PoinTer to NEXT WHITEspace)
  8853.      
  8854.      KWIC:           get the pointer to the %next %whitespace in a string
  8855.      
  8856.      syntax:         #include "hhstring.h"
  8857.                      char *ptrnextwhite(char *stringptr)
  8858.      
  8859.      description:    this function returns a pointer to the next "white char"
  8860.                      (either a blank or a tab) in the input string following
  8861.                      the character that is pointed to by the input pointer. If
  8862.                      no such character is found before the end of string, then
  8863.                      a NULL is returned.
  8864.      
  8865.      returns:        a pointer to the next "white char" or a NULL if no "white
  8866.                      char" is found
  8867.      
  8868.      comments:       like most of the ptrnext<...> functions, this one is a
  8869.                      macro which uses the corresponding ptrfirst<...>
  8870.                      function. The ptrnext<...> functions are maintained
  8871.                      primarily for the sake of consistency among the names
  8872.                      in HHSTRING. Also, the self-documented feature of the name
  8873.                      seems to us to outweigh the apparent ridiculousness of
  8874.                      maintaining a large group of macros which do nothing
  8875.                      more than add one to a pointer in a call to an existing
  8876.                      function.
  8877.      
  8878.      keywords:       pointer, next, character, whitespace, blank, tab
  8879.      
  8880.      key sentence:   gets the pointer to the next whitespace in a string
  8881.      
  8882.      see also:       ptr< first | last | next | prev >{not}blank
  8883.                      ptr< first | last | next | prev >{not}white
  8884.      
  8885.  
  8886.  
  8887.  
  8888.  
  8889.  
  8890.  
  8891.  
  8892.  
  8893.  
  8894.  
  8895.  
  8896.  
  8897.  
  8898.  
  8899.  
  8900.  
  8901.                          The Hobbit House String Library               page 139
  8902.  
  8903.  
  8904.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8905.      ║ NEXTWH.C     ║   file date: 03/13/93    page   2 of   2 ║ NEXTWH.C     ║
  8906.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8907.  
  8908.      
  8909.      
  8910.      usage example:  compiled/executed/verified on 1/1/93
  8911.      
  8912.                      char *Astring = "thisisthesample string";
  8913.                      char *Bstring = "thisisthesample\tstring";
  8914.                      printf("\n-->%s<--", ptrnextwhite(Astring+5));
  8915.                      printf("\n-->%s<--", ptrnextwhite(Bstring+5));
  8916.      
  8917.                      --> string<--
  8918.                      -->     string<--       (NOTE: the whitespace is
  8919.                                                     the expanded '\t')
  8920.      
  8921.                               ┌───────────────────────┐
  8922.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  8923.                               └───────────────────────┘                      */
  8924.  
  8925.  
  8926.  
  8927.  
  8928.  
  8929.  
  8930.  
  8931.  
  8932.  
  8933.  
  8934.  
  8935.  
  8936.  
  8937.  
  8938.  
  8939.  
  8940.  
  8941.  
  8942.  
  8943.  
  8944.  
  8945.  
  8946.  
  8947.  
  8948.  
  8949.  
  8950.  
  8951.  
  8952.  
  8953.  
  8954.  
  8955.  
  8956.  
  8957.  
  8958.  
  8959.  
  8960.  
  8961.  
  8962.      page 140            The Hobbit House String Library
  8963.  
  8964.  
  8965.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  8966.      ║ NEXTWORD.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTWORD.C   ║
  8967.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  8968.  
  8969.      /*                       ┌───────────────────────┐             ptrnextword
  8970.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  8971.                               └───────────────────────┘
  8972.                                copyright(c) 1992, 1993
  8973.      
  8974.      function:       ptrnextword (get PoinTeR to NEXT WORD)
  8975.      
  8976.      KWIC:           get the pointer to the %next %word in a string
  8977.      
  8978.      syntax:         #include "hhstring.h"
  8979.                      char *ptrnextword(char *instring)
  8980.      
  8981.      description:    this function returns a pointer to the next word in
  8982.                      instring. If there is no next word, then a NULL is
  8983.                      returned. The "next word" means the first non-whitespace
  8984.                      character following the first whitespace character
  8985.                      following instring. Think about it this way; from
  8986.                      instring, you look for the next whitespace and then from
  8987.                      there you look for the next non-whitespace. That way, you
  8988.                      get the next word whether instring starts with a word or
  8989.                      not.
  8990.      
  8991.      returns:        a pointer to the next word
  8992.      
  8993.      comments:       while most of the "ptrnext..." functions are macros
  8994.                      using the corresponding "ptrfirst..." function, that
  8995.                      cannot be done with this function because it is
  8996.                      word-oriented not character-oriented
  8997.      
  8998.      keywords:       pointer, next, word
  8999.      
  9000.      key sentence:   gets the pointer to the next word in a string
  9001.      
  9002.      see also:       ptr< first | last | next | this | prev>word
  9003.      
  9004.  
  9005.  
  9006.  
  9007.  
  9008.  
  9009.  
  9010.  
  9011.  
  9012.  
  9013.  
  9014.  
  9015.  
  9016.  
  9017.  
  9018.  
  9019.  
  9020.  
  9021.  
  9022.  
  9023.                          The Hobbit House String Library               page 141
  9024.  
  9025.  
  9026.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9027.      ║ NEXTWORD.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTWORD.C   ║
  9028.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9029.  
  9030.      
  9031.      
  9032.      usage example:  compiled/executed/verified on 1/6/93
  9033.      
  9034.                      char *Astring = "label1    size3";
  9035.                      char *Bstring = "lab2\t\t  size4";
  9036.                      char *Cstring = "lab4           ";
  9037.                      printf("\n-->%s<--", ptrnextword(Astring));
  9038.                      printf("\n-->%s<--", ptrnextword(Bstring+4));
  9039.                      printf("\n-->%s<--", ptrnextword(Cstring+4));
  9040.      
  9041.                      -->size3<--
  9042.                      -->size4<--
  9043.                      -->(null)<--
  9044.      
  9045.                               ┌───────────────────────┐
  9046.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9047.                               └───────────────────────┘                      */
  9048.  
  9049.  
  9050.  
  9051.  
  9052.  
  9053.  
  9054.  
  9055.  
  9056.  
  9057.  
  9058.  
  9059.  
  9060.  
  9061.  
  9062.  
  9063.  
  9064.  
  9065.  
  9066.  
  9067.  
  9068.  
  9069.  
  9070.  
  9071.  
  9072.  
  9073.  
  9074.  
  9075.  
  9076.  
  9077.  
  9078.  
  9079.  
  9080.  
  9081.  
  9082.  
  9083.  
  9084.      page 142            The Hobbit House String Library
  9085.  
  9086.  
  9087.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9088.      ║ NEXTWDTR.C   ║   file date: 03/13/93    page   1 of   2 ║ NEXTWDTR.C   ║
  9089.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9090.  
  9091.      /*                       ┌───────────────────────┐         ptrnextwordterm
  9092.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9093.                               └───────────────────────┘
  9094.                                copyright(c) 1992, 1993
  9095.      
  9096.      function:       ptrnextwordterm (get PoinTeR to NEXT WORD TERMinator)
  9097.      
  9098.      KWIC:           get the pointer to the %next %word terminator in a string
  9099.      
  9100.      syntax:         #include "hhstring.h"
  9101.                      char *ptrnextwordterm(char *ptr)
  9102.      
  9103.      description:    this function returns a pointer to the first word
  9104.                      terminator in memory following the given pointer. if the
  9105.                      pointer points at a word terminator, that will NOT be the
  9106.                      one pointed to upon return.
  9107.      
  9108.      returns:        a pointer to the next word terminator (since the string
  9109.                      terminator is a legal word terminator, this function will
  9110.                      never return a but may return a pointer to the string
  9111.                      terminator.
  9112.      
  9113.      comments:       like most of the ptrnext<...> functions, this one is a
  9114.                      macro which uses the corresponding ptrfirst<...>
  9115.                      function. The ptrnext<...> functions are maintained
  9116.                      primarily for the sake of consistency among the names
  9117.                      in HHSTRING. Also, the self-documented feature of the name
  9118.                      seems to us to outweigh the apparent ridiculousness of
  9119.                      maintaining a large group of macros which do nothing
  9120.                      more than add one to a pointer in a call to an existing
  9121.                      function.
  9122.      
  9123.      keywords:       pointer, next, character, word, terminator
  9124.      
  9125.      key sentence:   gets the pointer to the next word terminator in a string
  9126.      
  9127.      see also:       ptr< first | last | next | prev >wordterm
  9128.      
  9129.  
  9130.  
  9131.  
  9132.  
  9133.  
  9134.  
  9135.  
  9136.  
  9137.  
  9138.  
  9139.  
  9140.  
  9141.  
  9142.  
  9143.  
  9144.  
  9145.                          The Hobbit House String Library               page 143
  9146.  
  9147.  
  9148.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9149.      ║ NEXTWDTR.C   ║   file date: 03/13/93    page   2 of   2 ║ NEXTWDTR.C   ║
  9150.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9151.  
  9152.      
  9153.      
  9154.      usage example:  compiled/executed/verified on 1/31/93
  9155.      
  9156.                      char *Astring = "thisis.thesample string";
  9157.                      char *Bstring = "none_in_here.";
  9158.                      printf("\n%s", ptrnextwordterm(Astring));
  9159.                      printf("\n-->%s<--", ptrnextwordterm(Bstring));
  9160.      
  9161.                       string
  9162.                      --><--
  9163.      
  9164.      
  9165.                               ┌───────────────────────┐
  9166.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9167.                               └───────────────────────┘                      */
  9168.  
  9169.  
  9170.  
  9171.  
  9172.  
  9173.  
  9174.  
  9175.  
  9176.  
  9177.  
  9178.  
  9179.  
  9180.  
  9181.  
  9182.  
  9183.  
  9184.  
  9185.  
  9186.  
  9187.  
  9188.  
  9189.  
  9190.  
  9191.  
  9192.  
  9193.  
  9194.  
  9195.  
  9196.  
  9197.  
  9198.  
  9199.  
  9200.  
  9201.  
  9202.  
  9203.  
  9204.  
  9205.  
  9206.      page 144            The Hobbit House String Library
  9207.  
  9208.  
  9209.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9210.      ║ PREVBLK.C    ║   file date: 03/13/93    page   1 of   1 ║ PREVBLK.C    ║
  9211.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9212.  
  9213.      /*                       ┌───────────────────────┐            ptrprevblank
  9214.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9215.                               └───────────────────────┘
  9216.                                copyright(c) 1992, 1993
  9217.      
  9218.      function:       ptrprevblank (get PoinTeR to PREVious BLANK)
  9219.      
  9220.      KWIC:           get the pointer to the %previous %blank
  9221.      
  9222.      syntax:         #include "hhstring.h"
  9223.                      char *ptrprevblank(char *ptr)
  9224.      
  9225.      description:    gets a pointer to first blank found when scanning
  9226.                      backwards from the specified pointer. If the pointer
  9227.                      points to a blank, that will NOT be the one pointed
  9228.                      to upon return.
  9229.      
  9230.      returns:        a pointer to the previous blank
  9231.      
  9232.      comments:       note that this function skips over EVERYTHING except
  9233.                      blanks which means that it will not stop at variable
  9234.                      boundaries but will just scan all of memory (backwards)
  9235.                      until a blank is found. If you point it somewhere in
  9236.                      a string that doesn't have any blanks, the pointer you
  9237.                      get back will NOT be the start of the string. Be careful!
  9238.      
  9239.      keywords:       pointer, previous, character, blank
  9240.      
  9241.      key sentence:   gets the pointer to the first occurrence, previous to a
  9242.                      given pointer, of a blank
  9243.      
  9244.      see also:       ptr< first | last | next | prev >{not}blank
  9245.                      ptr< first | last | next | prev >{not}white
  9246.      
  9247.      usage example:  compiled/executed/verified on 12/15/92
  9248.      
  9249.                      char *Astring = "This is the Sample string";
  9250.                      printf("%s", ptrprevblank(Astring + 7));
  9251.      
  9252.                       is the Sample string
  9253.      
  9254.                               ┌───────────────────────┐
  9255.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9256.                               └───────────────────────┘                      */
  9257.  
  9258.  
  9259.  
  9260.  
  9261.  
  9262.  
  9263.  
  9264.  
  9265.  
  9266.  
  9267.                          The Hobbit House String Library               page 145
  9268.  
  9269.  
  9270.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9271.      ║ PREVCHR.C    ║   file date: 03/13/93    page   1 of   1 ║ PREVCHR.C    ║
  9272.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9273.  
  9274.      /*                       ┌───────────────────────┐              ptrprevchr
  9275.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9276.                               └───────────────────────┘
  9277.                                copyright(c) 1992, 1993
  9278.      
  9279.      function:       ptrprevchr (get PoinTeR to PREVious occurrence of a
  9280.                                  specified CHaRacter)
  9281.      
  9282.      KWIC:           get the pointer to the %previous occurrence of a
  9283.                      %character
  9284.      
  9285.      syntax:         #include "hhstring.h"
  9286.                      char *ptrprevchr(char *ptr, char inchar)
  9287.      
  9288.      description:    gets a pointer to first occurrence of inchar found when
  9289.                      scanning backwards from the specified pointer. If the
  9290.                      pointer pointers to an occurrence of inchar, that will
  9291.                      NOT be the one pointed to upon return.
  9292.      
  9293.      returns:        a pointer to the previous inchar
  9294.      
  9295.      comments:       note that this function skips over EVERYTHING except
  9296.                      inchar which means that it will not stop at variable
  9297.                      boundaries but will just scan all of memory (backwards)
  9298.                      until inchar is found. If you point it somewhere in
  9299.                      a string that doesn't have an inchar, the pointer you
  9300.                      get back will NOT be in the string. Be careful!
  9301.      
  9302.      keywords:       pointer, previous, character
  9303.      
  9304.      key sentence:   gets the pointer to the first occurrence, previous to a
  9305.                      given pointer, of a given character
  9306.      
  9307.      see also:       ptr< first | last | next | prev >{not}chr{i}
  9308.      
  9309.      usage example:  compiled/executed/verified on 12/15/92
  9310.      
  9311.                      char *Astring = "This is the Sample string";
  9312.                      printf("%s", ptrprevchr(Astring + 17, 's'));
  9313.      
  9314.                      s the Sample string
  9315.      
  9316.                               ┌───────────────────────┐
  9317.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9318.                               └───────────────────────┘                      */
  9319.  
  9320.  
  9321.  
  9322.  
  9323.  
  9324.  
  9325.  
  9326.  
  9327.  
  9328.      page 146            The Hobbit House String Library
  9329.  
  9330.  
  9331.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9332.      ║ PREVCHRI.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVCHRI.C   ║
  9333.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9334.  
  9335.      /*                       ┌───────────────────────┐             ptrprevchri
  9336.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9337.                               └───────────────────────┘
  9338.                                copyright(c) 1992, 1993
  9339.      
  9340.      function:       ptrprevchri (get PoinTeR to PREVious occurrence of a
  9341.                                   specified CHaRacter, Independant of case)
  9342.      
  9343.      KWIC:           get the pointer to the %previous occurrence of a
  9344.                      %character, %independent of case
  9345.      
  9346.      syntax:         #include "hhstring.h"
  9347.                      char *ptrprevchri(char *ptr, char inchar)
  9348.      
  9349.      description:    gets a pointer to first occurrence of inchar, independent
  9350.                      of case, found when scanning backwards from the specified
  9351.                      pointer. If the pointer points to an occurrence of inchar,
  9352.                      that will NOT be the one pointed to upon return.
  9353.      
  9354.      returns:        a pointer to the previous inchar
  9355.      
  9356.      comments:       note that this function skips over EVERYTHING except
  9357.                      inchar which means that it will not stop at variable
  9358.                      boundaries but will just scan all of memory (backwards)
  9359.                      until inchar is found. If you point it somewhere in
  9360.                      a string that doesn't have an inchar, the pointer you
  9361.                      get back will NOT be in the string. Be careful!
  9362.      
  9363.      keywords:       pointer, previous, character, case-independent
  9364.      
  9365.      key sentence:   gets the pointer to the first occurrence, previous to a
  9366.                      given pointer, of a specified character, independent of
  9367.                      case
  9368.      
  9369.      see also:       ptr< first | last | next | prev >{not}chr{i}
  9370.      
  9371.      usage example:  compiled/executed/verified on 12/15/92
  9372.      
  9373.                      char *Astring = "This is the Sample string";
  9374.                      printf("%s", ptrprevchri(Astring + 17, 's'));
  9375.      
  9376.                      Sample string
  9377.      
  9378.                               ┌───────────────────────┐
  9379.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9380.                               └───────────────────────┘                      */
  9381.  
  9382.  
  9383.  
  9384.  
  9385.  
  9386.  
  9387.  
  9388.  
  9389.                          The Hobbit House String Library               page 147
  9390.  
  9391.  
  9392.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9393.      ║ PREVDIG.C    ║   file date: 03/13/93    page   1 of   1 ║ PREVDIG.C    ║
  9394.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9395.  
  9396.      /*                       ┌───────────────────────┐              ptrprevdig
  9397.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9398.                               └───────────────────────┘
  9399.                                copyright(c) 1992, 1993
  9400.      
  9401.      function:       ptrprevdig (get PoinTeR to PREVious decimal DIGit in
  9402.                                  a string)
  9403.      
  9404.      KWIC:           get the pointer to the %previous %decimal %digit
  9405.      
  9406.      syntax:         #include "hhstring.h"
  9407.                      char *ptrprevdig(char *string)
  9408.      
  9409.      description:    gets a pointer to the first decimal digit found when
  9410.                      scanning backwards from the the specified pointer. If
  9411.                      the pointer points to a decimal digit, that is NOT the
  9412.                      one that will be pointed to on return.
  9413.      
  9414.      returns:        a pointer to the previous hex digit
  9415.      
  9416.      comments:       if this function is pointed to somewhere in a string
  9417.                      that doesn't contain any decimal digits, it will return
  9418.                      a pointer that is NOT in the string. Be careful.
  9419.      
  9420.      keywords:       pointer, previous, character, decimal, digit
  9421.      
  9422.      key sentence:   gets the pointer to the first occurrence, previous to a
  9423.                      given pointer, of any character which is a decimal digit
  9424.      
  9425.      see also:       ptr< first | last | next | prev >{not}dig
  9426.                      ptr< first | last | next | prev >{not}hex
  9427.      
  9428.      usage example:  compiled/executed/verified on 1/7/93
  9429.      
  9430.                      char *Astring = " 123 abc this is it";
  9431.                      printf("\n%s", ptrprevdig(Astring + 9));
  9432.      
  9433.                      3 abc this is it
  9434.      
  9435.                               ┌───────────────────────┐
  9436.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9437.                               └───────────────────────┘                      */
  9438.  
  9439.  
  9440.  
  9441.  
  9442.  
  9443.  
  9444.  
  9445.  
  9446.  
  9447.  
  9448.  
  9449.  
  9450.      page 148            The Hobbit House String Library
  9451.  
  9452.  
  9453.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9454.      ║ PREVGR.C     ║   file date: 03/13/93    page   1 of   1 ║ PREVGR.C     ║
  9455.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9456.  
  9457.      /*                       ┌───────────────────────┐               ptrprevgr
  9458.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9459.                               └───────────────────────┘
  9460.                                copyright(c) 1992, 1993
  9461.      
  9462.      function:       ptrprevgr (get PoinTeR to PREVious occurrence of any of
  9463.                                  the characters in a GRoup of characters)
  9464.      
  9465.      KWIC:           get the pointer to the %previous occurrence of a character
  9466.                      from a %group of characters
  9467.      
  9468.      syntax:         #include "hhstring.h"
  9469.                      char *ptrprevgr(char *ptr, char *chars)
  9470.      
  9471.      description:    memory is searched, backwards, starting one character
  9472.                      before the specified pointer. This continues until a
  9473.                      character is found which in the specified group.
  9474.      
  9475.      returns:        a pointer to the character found, or if the character
  9476.                      group is empty, then a NULL will be returned
  9477.      
  9478.      comments:       this function doesn't honor string boundaries, so if
  9479.                      it is given a pointer in a string that does not contain
  9480.                      any of the given characters, it will keep searching
  9481.                      backwards through memory until it finds one. If nowhere
  9482.                      else, it will certainly find one in itself, so the worst
  9483.                      case is that it will read 64K bytes and then exit with
  9484.                      a garbage pointer. BE CAREFUL!
  9485.      
  9486.      keywords:       pointer, previous, character, group
  9487.      
  9488.      key sentence:   gets the pointer to the first occurrence, previous to a
  9489.                      given pointer, of any character in a group of characters
  9490.      
  9491.      see also:       ptr< first | last | next | prev >{not}range
  9492.                      ptr< first | last | next | prev >{not}gr
  9493.      
  9494.      usage example:  compiled/executed/verified on 2/4/93
  9495.      
  9496.                      char *Astring = "This is it: the Sample string";
  9497.                      printf("\n%s", ptrprevgr(Astring + 20, ",.:;!?"));
  9498.      
  9499.                      : the Sample string
  9500.      
  9501.                               ┌───────────────────────┐
  9502.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9503.                               └───────────────────────┘                      */
  9504.  
  9505.  
  9506.  
  9507.  
  9508.  
  9509.  
  9510.  
  9511.                          The Hobbit House String Library               page 149
  9512.  
  9513.  
  9514.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9515.      ║ PREVHEX.C    ║   file date: 03/13/93    page   1 of   1 ║ PREVHEX.C    ║
  9516.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9517.  
  9518.      /*                       ┌───────────────────────┐              ptrprevhex
  9519.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9520.                               └───────────────────────┘
  9521.                                copyright(c) 1992, 1993
  9522.      
  9523.      function:       ptrprevhex (get PoinTeR to PREVious HEX digit in a string)
  9524.      
  9525.      KWIC:           get the pointer to the %previous %hex digit
  9526.      
  9527.      syntax:         #include "hhstring.h"
  9528.                      char *ptrprevhex(char *string)
  9529.      
  9530.      description:    gets a pointer to the first hex digit found when scanning
  9531.                      backwards from the the specified pointer. If the pointer
  9532.                      points to a hex digit, that is NOT the one that will be
  9533.                      pointed to on return.
  9534.      
  9535.      returns:        a pointer to the previous hex digit
  9536.      
  9537.      comments:       if this function is pointed to somewhere in a string
  9538.                      that doesn't contain any hex digits, it will return a
  9539.                      pointer that is NOT in the string. Be careful.
  9540.      
  9541.      keywords:       pointer, previous, character, hex, digit
  9542.      
  9543.      key sentence:   gets the pointer to the first occurrence, previous to a
  9544.                      given pointer, of any character which is a hex digit
  9545.      
  9546.      see also:       ptr< first | last | next | prev >{not}dig
  9547.                      ptr< first | last | next | prev >{not}hex
  9548.      
  9549.      usage example:  compiled/executed/verified on 1/7/93
  9550.      
  9551.                      char *Astring = " 123 abc this is it";
  9552.                      printf("\n%s", ptrprevhex(Astring + 9));
  9553.      
  9554.                      c this is it
  9555.      
  9556.                               ┌───────────────────────┐
  9557.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9558.                               └───────────────────────┘                      */
  9559.  
  9560.  
  9561.  
  9562.  
  9563.  
  9564.  
  9565.  
  9566.  
  9567.  
  9568.  
  9569.  
  9570.  
  9571.  
  9572.      page 150            The Hobbit House String Library
  9573.  
  9574.  
  9575.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9576.      ║ PREVNOBK.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVNOBK.C   ║
  9577.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9578.  
  9579.      /*                       ┌───────────────────────┐         ptrprevnotblank
  9580.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9581.                               └───────────────────────┘
  9582.                                copyright(c) 1992, 1993
  9583.      
  9584.      function:       ptrprevnotblank (get PoinTeR to PREVious NOT-BLANK)
  9585.      
  9586.      KWIC:           get the pointer to the %previous %non-blank character
  9587.      
  9588.      syntax:         #include "hhstring.h"
  9589.                      char *ptrprevnotblank(char *ptr)
  9590.      
  9591.      description:    gets a pointer to first non-blank found when scanning
  9592.                      backwards from the specified pointer. If the pointer
  9593.                      points to a non-blank, that will NOT be the one pointed
  9594.                      to upon return.
  9595.      
  9596.      returns:        a pointer to the previous non-blank
  9597.      
  9598.      comments:       none
  9599.      
  9600.      keywords:       pointer, previous, character, not, blank
  9601.      
  9602.      key sentence:   gets the pointer to the first occurrence, previous to a
  9603.                      given pointer, of any character other than a blank
  9604.      
  9605.      see also:       ptr< first | last | next | prev >{not}blank
  9606.                      ptr< first | last | next | prev >{not}white
  9607.      
  9608.      usage example:  compiled/executed/verified on 1/7/93
  9609.      
  9610.                      char *Astring = "This is the Sample string";
  9611.                      printf("%s", ptrprevnotblank(Astring + 8));
  9612.      
  9613.                      s the Sample string
  9614.      
  9615.                               ┌───────────────────────┐
  9616.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9617.                               └───────────────────────┘                      */
  9618.  
  9619.  
  9620.  
  9621.  
  9622.  
  9623.  
  9624.  
  9625.  
  9626.  
  9627.  
  9628.  
  9629.  
  9630.  
  9631.  
  9632.  
  9633.                          The Hobbit House String Library               page 151
  9634.  
  9635.  
  9636.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9637.      ║ PREVNOCH.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVNOCH.C   ║
  9638.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9639.  
  9640.      /*                       ┌───────────────────────┐           ptrprevnotchr
  9641.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9642.                               └───────────────────────┘
  9643.                                copyright(c) 1992, 1993
  9644.      
  9645.      function:       ptrprevnotchr (get PoinTeR, to PREVious, NOT the specified
  9646.                                     CHaRacter)
  9647.      
  9648.      KWIC:           get the pointer to the %previous occurrence of a character
  9649.                      which is not the specified %character
  9650.      
  9651.      syntax:         #include "hhstring.h"
  9652.                      char *ptrprevnotchr(char *ptr, char inchar)
  9653.      
  9654.      description:    gets a pointer to first occurrence, found when scanning
  9655.                      backwards from the specified pointer, of a character which
  9656.                      is not inchar. If the pointer pointers to a character
  9657.                                                                           which
  9658.                      is not inchar, that will NOT be the one pointed to upon
  9659.                      return.
  9660.      
  9661.      returns:        a pointer to the previous non-inchar character
  9662.      
  9663.      comments:       note that this function just scans memory (backwards)
  9664.                                                                           until
  9665.                      a non-inchar character is found. If you point it somewhere
  9666.                      in a string that contains only inchar, the pointer you get
  9667.                      back will NOT be in the string. Be careful!
  9668.      
  9669.      keywords:       pointer, character, previous, not
  9670.      
  9671.      key sentence:   gets the pointer to the first occurrence, previous to a
  9672.                      given pointer, of any character other than a given
  9673.                      character
  9674.      
  9675.      see also:       ptr< first | last | next | prev >{not}chr{i}
  9676.      
  9677.      usage example:  compiled/executed/verified on 1/7/93
  9678.      
  9679.                      char *Astring = "This is the Sample string*******";
  9680.                      printf("\n%s", ptrprevnotchr(strend(Astring), '*'));
  9681.      
  9682.                      g*******
  9683.      
  9684.                               ┌───────────────────────┐
  9685.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9686.                               └───────────────────────┘                      */
  9687.  
  9688.  
  9689.  
  9690.  
  9691.  
  9692.  
  9693.  
  9694.      page 152            The Hobbit House String Library
  9695.  
  9696.  
  9697.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9698.      ║ PREVNOCI.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVNOCI.C   ║
  9699.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9700.  
  9701.      /*                       ┌───────────────────────┐          ptrprevnotchri
  9702.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9703.                               └───────────────────────┘
  9704.                                copyright(c) 1992, 1993
  9705.      
  9706.      function:       ptrprevnotchri (get PoinTeR to PREVious occurrence of any
  9707.                                      character which is NOT  the specified
  9708.                                      CHaRacter, Independant of case)
  9709.      
  9710.      KWIC:           get the pointer to the %previous occurrence of a character
  9711.                      which is not the specified %character, %independent of
  9712.                      case
  9713.      
  9714.      syntax:         #include "hhstring.h"
  9715.                      char *ptrprevnotchri(char *ptr, char inchar)
  9716.      
  9717.      description:    gets a pointer to first occurrence found, when scanning
  9718.                      backwards from the specified pointer, of any character
  9719.                                                                           which
  9720.                      is not inchar, independent of case. If the pointer points
  9721.                                                                              to
  9722.                      an occurrence of a character other than inchar, that will
  9723.                                                                             NOT
  9724.                      be the one pointed to upon return.
  9725.      
  9726.      returns:        a pointer to the character found
  9727.      
  9728.      comments:       note that this function keeps scanning (backwards) until a
  9729.                      non-inchar is found. If you point it somewhere in a string
  9730.                      that consists of only inchar characters, the pointer you
  9731.                                                                             get
  9732.                      back will NOT be in the string. Be careful!
  9733.      
  9734.      keywords:       pointer, previous, not, case-independent
  9735.      
  9736.      key sentence:   gets the pointer to the first occurrence, previous to a
  9737.                      given pointer, of any character which, independent of
  9738.                      case, is not a specified character
  9739.      
  9740.      see also:       ptr< first | last | next | prev >{not}chr{i}
  9741.      
  9742.      usage example:  compiled/executed/verified on 1/7/93
  9743.      
  9744.                      char *Astring = "This is the Sample string.......";
  9745.                      printf("%s", ptrprevnotchri(Astring + strlen(Astring),
  9746.                                                                          '.'));
  9747.      
  9748.                      g.......
  9749.      
  9750.                               ┌───────────────────────┐
  9751.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9752.                               └───────────────────────┘                      */
  9753.  
  9754.  
  9755.                          The Hobbit House String Library               page 153
  9756.  
  9757.  
  9758.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9759.      ║ PREVNODG.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVNODG.C   ║
  9760.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9761.  
  9762.      /*                       ┌───────────────────────┐           ptrprevnotdig
  9763.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9764.                               └───────────────────────┘
  9765.                                copyright(c) 1992, 1993
  9766.      
  9767.      function:       ptrprevnotdig (get PoinTeR to PREVious NOT decimal DIGit)
  9768.      
  9769.      KWIC:           get the pointer to the %previous character which is not a
  9770.                      %decimal digit
  9771.      
  9772.      syntax:         #include "hhstring.h"
  9773.                      char *ptrprevnotdig(char *string)
  9774.      
  9775.      description:    gets a pointer to the first character found, when scanning
  9776.                      backwards from the the specified pointer, which is not a
  9777.                      decimal digit. If the pointer points to a decimal digit,
  9778.                      that is NOT the one that will be pointed to on return.
  9779.      
  9780.      returns:        a pointer to the character
  9781.      
  9782.      comments:       if this function is pointed to somewhere in a string
  9783.                      that contains only decimal digits, it will return
  9784.                      a pointer that is NOT in the string. Be careful.
  9785.      
  9786.      keywords:       pointer, previous, character, not, decimal, digit
  9787.      
  9788.      key sentence:   gets the pointer to the first occurrence, previous to a
  9789.                      given pointer, of any character which is not a decimal
  9790.                      digit
  9791.      
  9792.      see also:       ptr< first | last | next | prev >{not}dig
  9793.                      ptr< first | last | next | prev >{not}hex
  9794.      
  9795.      usage example:  compiled/executed/verified on 1/7/93
  9796.      
  9797.                      char *Astring = " this is it: 12345";
  9798.                      printf("\n%s", ptrprevnotdig(Astring + strlen(Astring)));
  9799.      
  9800.                       12345
  9801.      
  9802.                               ┌───────────────────────┐
  9803.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9804.                               └───────────────────────┘                      */
  9805.  
  9806.  
  9807.  
  9808.  
  9809.  
  9810.  
  9811.  
  9812.  
  9813.  
  9814.  
  9815.  
  9816.      page 154            The Hobbit House String Library
  9817.  
  9818.  
  9819.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9820.      ║ PREVNOGR.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVNOGR.C   ║
  9821.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9822.  
  9823.      /*                       ┌───────────────────────┐            ptrprevnotgr
  9824.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9825.                               └───────────────────────┘
  9826.                                copyright(c) 1992, 1993
  9827.      
  9828.      function:       ptrprevnotgr (get PoinTeR to PREVious occurrence of any
  9829.                                     character which is NOT in a GRoup of
  9830.                                     characters)
  9831.      
  9832.      KWIC:           get the pointer to the %previous character not in a %group
  9833.                      of characters
  9834.      
  9835.      syntax:         #include <stddef.h>
  9836.                      #include "hhstring.h"
  9837.                      char *ptrprevnotgr(char *ptr, char *chars)
  9838.      
  9839.      description:    memory is searched, backwards, starting one character
  9840.                      before the specified pointer. This continues until a
  9841.                      character is found which is not in the specified group.
  9842.      
  9843.      returns:        a pointer to the character found.
  9844.      
  9845.      comments:       this function doesn't honor string boundaries, so if
  9846.                      it is given a pointer in a string that does not contain
  9847.                      any of the given characters, it will keep searching
  9848.                      backwards through memory until it finds one. If nowhere
  9849.                      else, it will certainly find one in itself, so the worst
  9850.                      case is that it will read 64K bytes and then exit with
  9851.                      a garbage pointer. BE CAREFUL!
  9852.      
  9853.      keywords:       pointer, previous, character, not, group
  9854.      
  9855.      key sentence:   gets the pointer to the first occurrence, previous to a
  9856.                      given pointer, of any character which is not in a given
  9857.                      group of characters
  9858.      
  9859.      see also:       ptr< first | last | next | prev >{not}range
  9860.                      ptr< first | last | next | prev >{not}gr
  9861.      
  9862.      usage example:  compiled/executed/verified on 2/4/93
  9863.      
  9864.                      char *Astring = "this is it:  -123,456,789.012  ";
  9865.                      printf("%s", ptrprevnotgr(Astring + 25, " ,.-123456789"));
  9866.      
  9867.                      :  -123,456,789.012
  9868.      
  9869.                               ┌───────────────────────┐
  9870.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9871.                               └───────────────────────┘                      */
  9872.  
  9873.  
  9874.  
  9875.  
  9876.  
  9877.                          The Hobbit House String Library               page 155
  9878.  
  9879.  
  9880.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9881.      ║ PREVNOHX.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVNOHX.C   ║
  9882.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9883.  
  9884.      /*                       ┌───────────────────────┐           ptrprevnothex
  9885.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9886.                               └───────────────────────┘
  9887.                                copyright(c) 1992, 1993
  9888.      
  9889.      function:       ptrprevnothex (get PoinTeR to PREVious NOT-HEX-digit)
  9890.      
  9891.      KWIC:           get the pointer to the %previous character which is not a
  9892.                      %hex digit
  9893.      
  9894.      syntax:         #include "hhstring.h"
  9895.                      char *ptrprevnothex(char *string)
  9896.      
  9897.      description:    gets a pointer to the first character found when scanning
  9898.                      backwards from the the specified pointer, which is not a
  9899.                                                                             hex
  9900.                      digit. If the pointer points to a non-hex digit, that is
  9901.                                                                             NOT
  9902.                      the one that will be pointed to on return.
  9903.      
  9904.      returns:        a pointer to the previous non-hex-digit
  9905.      
  9906.      comments:       if this function is pointed to somewhere in a string
  9907.                      that doesn't contain any hex digits, it will return a
  9908.                      pointer that is NOT in the string. Be careful.
  9909.      
  9910.      keywords:       pointer, previous, character, not, hex, digit
  9911.      
  9912.      key sentence:   gets the pointer to the first occurrence, previous to a
  9913.                      given pointer, of any character which is not a hex digit
  9914.      
  9915.      see also:       ptr< first | last | next | prev >{not}dig
  9916.                      ptr< first | last | next | prev >{not}hex
  9917.      
  9918.      usage example:  compiled/executed/verified on 1/7/93
  9919.      
  9920.                      char *Astring = "  this is it: a12ef3";
  9921.                      printf("\n%s", ptrprevnothex(Astring + strlen(Astring)));
  9922.      
  9923.                       a12ef3
  9924.      
  9925.                               ┌───────────────────────┐
  9926.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9927.                               └───────────────────────┘                      */
  9928.  
  9929.  
  9930.  
  9931.  
  9932.  
  9933.  
  9934.  
  9935.  
  9936.  
  9937.  
  9938.      page 156            The Hobbit House String Library
  9939.  
  9940.  
  9941.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  9942.      ║ PREVNORN.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVNORN.C   ║
  9943.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  9944.  
  9945.      /*                       ┌───────────────────────┐         ptrprevnotrange
  9946.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  9947.                               └───────────────────────┘
  9948.                                copyright(c) 1992, 1993
  9949.      
  9950.      function:       ptrprevnotrange (get PoinTeR, to PREVious, NOT in RANGE)
  9951.      
  9952.      KWIC:           get the pointer to the %previous occurrence of any
  9953.                                                                       character
  9954.                      not in a %range of characters
  9955.      
  9956.      syntax:         #include <stddef.h>
  9957.                      #include "hhstring.h"
  9958.                      char *ptrprevnotrange(char *ptr, char c1, char c2)
  9959.      
  9960.      description:    returns the pointer to the first occurrence in memory,
  9961.                                                                            when
  9962.                      scanning backwards from ptr, of any character not in the
  9963.                      range c1 to c2 inclusive
  9964.      
  9965.      returns:        a pointer to the character
  9966.      
  9967.      comments:       none
  9968.      
  9969.      keywords:       pointer, previous, not, character, range
  9970.      
  9971.      key sentence:   gets the pointer to the first occurrence, previous to a
  9972.                      given pointer, of any character which is not in a given
  9973.                      range of characters
  9974.      
  9975.      see also:       ptr< first | last | next | prev >{not}range
  9976.                      ptr< first | last | next | prev >{not}set
  9977.      
  9978.      usage example:  compiled/executed/verified on 1/7/93
  9979.      
  9980.                      char *Astring = "This is the {Sample} String";
  9981.                      printf("\n%s", ptrprevnotrange(Astring + 20, ' ', 'z'));
  9982.      
  9983.                      } String
  9984.      
  9985.                               ┌───────────────────────┐
  9986.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  9987.                               └───────────────────────┘                      */
  9988.  
  9989.  
  9990.  
  9991.  
  9992.  
  9993.  
  9994.  
  9995.  
  9996.  
  9997.  
  9998.  
  9999.                          The Hobbit House String Library               page 157
  10000.  
  10001.  
  10002.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10003.      ║ PREVNOTT.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVNOTT.C   ║
  10004.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10005.  
  10006.      /*                       ┌───────────────────────┐      ptrprevnottextterm
  10007.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10008.                               └───────────────────────┘
  10009.                                copyright(c) 1992, 1993
  10010.      
  10011.      function:       ptrprevnottextterm (get PoinTeR to PREVious NOT-TEXT-
  10012.                                          TERMinator)
  10013.      
  10014.      KWIC:           get the pointer to the %previous %non-text-terminator
  10015.                      character
  10016.      
  10017.      syntax:         #include "hhstring.h"
  10018.                      char *ptrprevnottextterm(char *ptr)
  10019.      
  10020.      description:    gets a pointer to first non-text-terminator found when
  10021.                      scanning backwards from the specified pointer. If the
  10022.                      pointer points to a non-text-terminator, that will NOT
  10023.                      be the one pointed to upon return.
  10024.      
  10025.      returns:        a pointer to the previous non-text-terminator
  10026.      
  10027.      comments:       a "text word" is a human language construct as opposed to
  10028.                      a "string word" which is simply a set of characters
  10029.                      surrounded by whitespace. The only distinction made by
  10030.                      this function library is in the terminator. "Words" are
  10031.                      terminated by a blank, a tab, an ASCII End-Of-Line (EOL)
  10032.                      or an End-Of-String (EOS). "Text words", however, may also
  10033.                      be terminated by any of these punctuation marks: .!?:;,
  10034.      
  10035.      keywords:       pointer, previous, character, not, text, terminator
  10036.      
  10037.      key sentence:   gets the pointer to the first occurrence, previous to a
  10038.                      given pointer, of any character other than a text
  10039.                      terminator
  10040.      
  10041.      see also:       ptr< first | last | next | prev >nottextterm
  10042.      
  10043.      usage example:  compiled/executed/verified on 1/31/93
  10044.      
  10045.                      char *Astring = "This is the Sample string";
  10046.                      printf("%s", ptrprevnottextterm(Astring + 8));
  10047.      
  10048.                      s the Sample string
  10049.      
  10050.                               ┌───────────────────────┐
  10051.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10052.                               └───────────────────────┘                      */
  10053.  
  10054.  
  10055.  
  10056.  
  10057.  
  10058.  
  10059.  
  10060.      page 158            The Hobbit House String Library
  10061.  
  10062.  
  10063.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10064.      ║ PREVNOWH.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVNOWH.C   ║
  10065.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10066.  
  10067.      /*                       ┌───────────────────────┐         ptrprevnotwhite
  10068.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10069.                               └───────────────────────┘
  10070.                                copyright(c) 1992, 1993
  10071.      
  10072.      function:       ptrprevnotwhite (get PoinTeR to PREVious NOT-WHITEspace)
  10073.      
  10074.      KWIC:           get the pointer to the %previous %non-whitespace character
  10075.      
  10076.      syntax:         #include "hhstring.h"
  10077.                      char *ptrprevnotwhite(char *ptr)
  10078.      
  10079.      description:    gets a pointer to first non-whitespace character found
  10080.                      when scanning backwards from the specified pointer. If
  10081.                      the pointer points to a non-whitespace character, that
  10082.                      will NOT be the one pointed to upon return.
  10083.      
  10084.      returns:        a pointer to the previous non-whitespace
  10085.      
  10086.      comments:       none
  10087.      
  10088.      keywords:       pointer, previous, character, not, whitespace, blank, tab
  10089.      
  10090.      key sentence:   gets the pointer to the first occurrence, previous to a
  10091.                      given pointer, of any character other than whitespace
  10092.      
  10093.      see also:       ptr< first | last | next | prev >{not}blank
  10094.                      ptr< first | last | next | prev >{not}white
  10095.      
  10096.      usage example:  compiled/executed/verified on 1/7/93
  10097.      
  10098.                      char *Astring = "This is\tthe sample string";
  10099.                      printf("%s", ptrprevnotwhite(Astring + 8));
  10100.      
  10101.                      s       the sample string               note: blanks are
  10102.                                                              the expanded TAB
  10103.      
  10104.                               ┌───────────────────────┐
  10105.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10106.                               └───────────────────────┘                      */
  10107.  
  10108.  
  10109.  
  10110.  
  10111.  
  10112.  
  10113.  
  10114.  
  10115.  
  10116.  
  10117.  
  10118.  
  10119.  
  10120.  
  10121.                          The Hobbit House String Library               page 159
  10122.  
  10123.  
  10124.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10125.      ║ PREVNOWT.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVNOWT.C   ║
  10126.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10127.  
  10128.      /*                       ┌───────────────────────┐      ptrprevnotwordterm
  10129.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10130.                               └───────────────────────┘
  10131.                                copyright(c) 1992, 1993
  10132.      
  10133.      function:       ptrprevnotwordterm (get PoinTeR to PREVious NOT-WORD-
  10134.                                          TERMinator)
  10135.      
  10136.      KWIC:           get the pointer to the %previous %non-word-terminator
  10137.                      character
  10138.      
  10139.      syntax:         #include "hhstring.h"
  10140.                      char *ptrprevnotwordterm(char *ptr)
  10141.      
  10142.      description:    gets a pointer to first non-word-terminator found when
  10143.                      scanning backwards from the specified pointer. If the
  10144.                      pointer points to a non-word-terminator, that will NOT
  10145.                      be the one pointed to upon return.
  10146.      
  10147.      returns:        a pointer to the previous non-word-terminator
  10148.      
  10149.      comments:       none
  10150.      
  10151.      keywords:       pointer, previous, character, not, word, terminator
  10152.      
  10153.      key sentence:   gets the pointer to the first occurrence, previous to a
  10154.                      given pointer, of any character other than a word
  10155.                      terminator
  10156.      
  10157.      see also:       ptr< first | last | next | prev >notwordterm
  10158.      
  10159.      usage example:  compiled/executed/verified on 1/31/93
  10160.      
  10161.                      char *Astring = "This is the Sample string";
  10162.                      printf("%s", ptrprevnotwordterm(Astring + 8));
  10163.      
  10164.                      s the Sample string
  10165.      
  10166.                               ┌───────────────────────┐
  10167.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10168.                               └───────────────────────┘                      */
  10169.  
  10170.  
  10171.  
  10172.  
  10173.  
  10174.  
  10175.  
  10176.  
  10177.  
  10178.  
  10179.  
  10180.  
  10181.  
  10182.      page 160            The Hobbit House String Library
  10183.  
  10184.  
  10185.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10186.      ║ PREVRAN.C    ║   file date: 03/13/93    page   1 of   1 ║ PREVRAN.C    ║
  10187.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10188.  
  10189.      /*                       ┌───────────────────────┐            ptrprevrange
  10190.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10191.                               └───────────────────────┘
  10192.                                copyright(c) 1992, 1993
  10193.      
  10194.      function:       ptrprevrange (get PoinTeR, PREVious, from RANGE)
  10195.      
  10196.      KWIC:           get the pointer to the %previous occurrence of any
  10197.                                                                       character
  10198.                      from a %range of characters
  10199.      
  10200.      syntax:         #include <stddef.h>
  10201.                      #include "hhstring.h"
  10202.                      char *ptrprevrange(char *ptr, char c1, char c2)
  10203.      
  10204.      description:    memory is scanned backwards, starting one character before
  10205.                      ptr, until an occurrence is found of a character which is
  10206.                      in the range c1 to c2 inclusive
  10207.      
  10208.      returns:        a pointer to the character found
  10209.      
  10210.      comments:       none
  10211.      
  10212.      keywords:       pointer, previous, character, range
  10213.      
  10214.      key sentence:   gets the pointer to the first occurrence, previous to a
  10215.                      given pointer, of any character from a given range of
  10216.                      characters
  10217.      
  10218.      see also:       ptr< first | last | next | prev >{not}range
  10219.                      ptr< first | last | next | prev >{not}set
  10220.      
  10221.      usage example:  compiled/executed/verified on 1/7/93
  10222.      
  10223.                      char *Astring = "This is it: the Sample string";
  10224.                      printf("\n%s", ptrprevrange(Astring + 20, '!', '?'));
  10225.      
  10226.                      : the Sample string
  10227.      
  10228.                               ┌───────────────────────┐
  10229.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10230.                               └───────────────────────┘                      */
  10231.  
  10232.  
  10233.  
  10234.  
  10235.  
  10236.  
  10237.  
  10238.  
  10239.  
  10240.  
  10241.  
  10242.  
  10243.                          The Hobbit House String Library               page 161
  10244.  
  10245.  
  10246.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10247.      ║ PREVSUB.C    ║   file date: 03/13/93    page   1 of   1 ║ PREVSUB.C    ║
  10248.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10249.  
  10250.      /*                       ┌───────────────────────┐              ptrprevsub
  10251.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10252.                               └───────────────────────┘
  10253.                                copyright(c) 1992, 1993
  10254.      
  10255.      function:       ptrprevsub (get PoinTer to PREVious occurrence of a
  10256.                                  SUBstring)
  10257.      
  10258.      KWIC:           get the pointer to the %previous occurrence of a
  10259.                      %substring
  10260.      
  10261.      syntax:         #include "hhstring.h"
  10262.                      char *ptrprevsub(char *ptr, char *substring)
  10263.      
  10264.      description:    gets a pointer to first occurrence of the substring found
  10265.                      when scanning backwards from the specified pointer. If the
  10266.                      pointer pointers to an occurrence of the substring, that
  10267.                                                                            will
  10268.                      NOT be the one pointed to upon return.
  10269.      
  10270.      returns:        a pointer to the substring found
  10271.      
  10272.      comments:       note that this function will just scan all of memory
  10273.                      (backwards) until inchar is found. If you point it
  10274.                      somewhere in a string that doesn't have an inchar, the
  10275.                      pointer you get back will NOT be in the string. Be
  10276.                      careful!
  10277.      
  10278.      keywords:       pointer, previous, substring
  10279.      
  10280.      key sentence:   gets the pointer to the first occurrence, previous to a
  10281.                      given pointer, of a given substring
  10282.      
  10283.      see also:       ptr< first | last | next | prev >sub{i}
  10284.      
  10285.      usage example:  compiled/executed/verified on 12/21/92
  10286.      
  10287.                      char *Astring = "This is the Sample string";
  10288.                      printf("%s", ptrprevsub(Astring + 25, "Sample"));
  10289.      
  10290.                      Sample string
  10291.      
  10292.                               ┌───────────────────────┐
  10293.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10294.                               └───────────────────────┘                      */
  10295.  
  10296.  
  10297.  
  10298.  
  10299.  
  10300.  
  10301.  
  10302.  
  10303.  
  10304.      page 162            The Hobbit House String Library
  10305.  
  10306.  
  10307.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10308.      ║ PREVSUBI.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVSUBI.C   ║
  10309.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10310.  
  10311.      /*                       ┌───────────────────────┐             ptrprevsubi
  10312.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10313.                               └───────────────────────┘
  10314.                                copyright(c) 1992, 1993
  10315.      
  10316.      function:       ptrprevsubi (get PoinTer to PREVious occurrence of a
  10317.                                  SUBstring, Independant of case)
  10318.      
  10319.      KWIC:           get thepointer to the %previous occurrence of a
  10320.                      %substring, %independent of case
  10321.      
  10322.      syntax:         #include "hhstring.h"
  10323.                      char *ptrprevsubi(char *ptr, char *substring)
  10324.      
  10325.      description:    gets a pointer to first case-independent occurrence of the
  10326.                      substring found when scanning backwards from the specified
  10327.                      pointer. If the pointer pointers to an occurrence of the
  10328.                      substring, that will NOT be the one pointed to upon
  10329.                                                                         return.
  10330.      
  10331.      returns:        a pointer to the substring found
  10332.      
  10333.      comments:       note that this function will just scan all of memory
  10334.                      (backwards) until inchar is found. If you point it
  10335.                      somewhere in a string that doesn't have an inchar, the
  10336.                      pointer you get back will NOT be in the string. Be
  10337.                      careful!
  10338.      
  10339.      keywords:       pointer, previous, substring, case-independent
  10340.      
  10341.      key sentence:   gets the pointer to the first occurrence, previous to a
  10342.                      given pointer, of a given substring, independent of case
  10343.      
  10344.      see also:       ptr< first | last | next | prev >sub{i}
  10345.      
  10346.      usage example:  compiled/executed/verified on 12/21/92
  10347.      
  10348.                      char *Astring = "This is the Sample string";
  10349.                      printf("%s", ptrprevsubi(Astring + 25, "SAMPLE"));
  10350.      
  10351.                      Sample string
  10352.      
  10353.                               ┌───────────────────────┐
  10354.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10355.                               └───────────────────────┘                      */
  10356.  
  10357.  
  10358.  
  10359.  
  10360.  
  10361.  
  10362.  
  10363.  
  10364.  
  10365.                          The Hobbit House String Library               page 163
  10366.  
  10367.  
  10368.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10369.      ║ PREVTEXT.C   ║   file date: 03/13/93    page   1 of   2 ║ PREVTEXT.C   ║
  10370.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10371.  
  10372.      /*                       ┌───────────────────────┐             ptrprevtext
  10373.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10374.                               └───────────────────────┘
  10375.                                copyright(c) 1992, 1993
  10376.      
  10377.      function:       ptrprevtext (get PoinTeR to PREVious TEXT word)
  10378.      
  10379.      KWIC:           get the pointer to the %previous %text word from a given
  10380.                      pointer
  10381.      
  10382.      syntax:         #include "hhstring.h"
  10383.                      char *ptrprevtext(char *ptr)
  10384.      
  10385.      description:    scans backwards for a character which is a text word
  10386.                      terminator (see comments below), then scans backward
  10387.                      for non-terminator, then scans backward for a terminator
  10388.                      again and returns the pointer to the text word following
  10389.                      that terminator. Think of it this way; given a pointer to
  10390.                      any point in a sentence, this function returns the pointer
  10391.                      to the word preceding the one pointed to. If the pointer
  10392.                      points at a text word terminator, this function returns
  10393.                      the pointer to the text word which precedes the
  10394.                      terminator.
  10395.      
  10396.      returns:        a pointer to the previous text word
  10397.      
  10398.      comments:       If the pointer points to the end of a string or to an EOL
  10399.                      ('\n'), the function will return a pointer to the last
  10400.                      word in the string.
  10401.      
  10402.                      If the input pointer points to the first word in a string,
  10403.                      prevword will NOT be that word but will be that word
  10404.                      preceded by all of the characters which precede it in
  10405.                      memory up to and including the previous text word.
  10406.                      Be careful!
  10407.      
  10408.      keywords:       pointer, previous, word, text
  10409.      
  10410.      key sentence:   gets the pointer to the text word previous to the position
  10411.                      pointed to
  10412.      
  10413.      see also:       ptr< first | last | next | this | prev>text
  10414.      
  10415.  
  10416.  
  10417.  
  10418.  
  10419.  
  10420.  
  10421.  
  10422.  
  10423.  
  10424.  
  10425.  
  10426.      page 164            The Hobbit House String Library
  10427.  
  10428.  
  10429.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10430.      ║ PREVTEXT.C   ║   file date: 03/13/93    page   2 of   2 ║ PREVTEXT.C   ║
  10431.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10432.  
  10433.      
  10434.      
  10435.      usage example:  compiled/executed/verified on 1/30/93
  10436.      
  10437.                      char str[80] = "time date size.other";
  10438.                      printf("\n%s", ptrprevtext(str+15));
  10439.                      printf("\n%s", ptrprevtext(str+13));
  10440.      
  10441.                      size.other
  10442.                      date size.other
  10443.      
  10444.                               ┌───────────────────────┐
  10445.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10446.                               └───────────────────────┘                      */
  10447.  
  10448.  
  10449.  
  10450.  
  10451.  
  10452.  
  10453.  
  10454.  
  10455.  
  10456.  
  10457.  
  10458.  
  10459.  
  10460.  
  10461.  
  10462.  
  10463.  
  10464.  
  10465.  
  10466.  
  10467.  
  10468.  
  10469.  
  10470.  
  10471.  
  10472.  
  10473.  
  10474.  
  10475.  
  10476.  
  10477.  
  10478.  
  10479.  
  10480.  
  10481.  
  10482.  
  10483.  
  10484.  
  10485.  
  10486.  
  10487.                          The Hobbit House String Library               page 165
  10488.  
  10489.  
  10490.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10491.      ║ PREVTXTR.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVTXTR.C   ║
  10492.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10493.  
  10494.      /*                       ┌───────────────────────┐         ptrprevtextterm
  10495.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10496.                               └───────────────────────┘
  10497.                                copyright(c) 1992, 1993
  10498.      
  10499.      function:       ptrprevtextterm (get PoinTeR to PREVious TEXT word
  10500.                                       TERMinator)
  10501.      
  10502.      KWIC:           get the pointer to the %previous %text word terminator
  10503.      
  10504.      syntax:         #include "hhstring.h"
  10505.                      char *ptrprevtextterm(char *ptr)
  10506.      
  10507.      description:    gets a pointer to first text word terminator found when
  10508.                      scanning backwards from the specified pointer. If the
  10509.                      pointer points to a text word terminator, that will NOT
  10510.                      be the one pointed to upon return.
  10511.      
  10512.      returns:        a pointer to the previous text word terminator
  10513.      
  10514.      comments:       note that this function skips over EVERYTHING except
  10515.                      word terminators which means that it will not stop at
  10516.                      string boundaries but will just scan all of memory
  10517.                      (backwards) until a text word terminator is found. If you
  10518.                      point it somewhere in a string that doesn't have any
  10519.                      preceding text word terminators, the pointer you get back
  10520.                      will NOT be the start of the string, but will most likely
  10521.                      be a pointer to the string terminator of the previous
  10522.                      string in memory. Be careful!
  10523.      
  10524.      keywords:       pointer, previous, character, text, word, terminator
  10525.      
  10526.      key sentence:   gets the pointer to the first occurrence, previous to a
  10527.                      given pointer, of a text word terminator
  10528.      
  10529.      see also:       ptr< first | last | next | prev >textterm
  10530.      
  10531.      usage example:  compiled/executed/verified on 1/31/93
  10532.      
  10533.                      char *Astring = "This is the Sample string";
  10534.                      printf("%s", ptrprevtextterm(Astring + 7));
  10535.      
  10536.                       is the Sample string
  10537.      
  10538.                               ┌───────────────────────┐
  10539.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10540.                               └───────────────────────┘                      */
  10541.  
  10542.  
  10543.  
  10544.  
  10545.  
  10546.  
  10547.  
  10548.      page 166            The Hobbit House String Library
  10549.  
  10550.  
  10551.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10552.      ║ PREVWH.C     ║   file date: 03/13/93    page   1 of   1 ║ PREVWH.C     ║
  10553.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10554.  
  10555.      /*                       ┌───────────────────────┐            ptrprevwhite
  10556.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10557.                               └───────────────────────┘
  10558.                                copyright(c) 1992, 1993
  10559.      
  10560.      function:       ptrprevwhite (get PoinTeR to PREVious WHITEspace)
  10561.      
  10562.      KWIC:           get the pointer to the %previous %whitespace character
  10563.      
  10564.      syntax:         #include "hhstring.h"
  10565.                      char *ptrprevwhite(char *ptr)
  10566.      
  10567.      description:    gets a pointer to first whitespace found when scanning
  10568.                      backwards from the specified pointer. If the pointer
  10569.                      points to a white character, that will NOT be the one
  10570.                      pointed to upon return.
  10571.      
  10572.      returns:        a pointer to the previous whitespace character
  10573.      
  10574.      comments:       note that this function skips over EVERYTHING except
  10575.                      blanks and tabs which means that it will not stop at
  10576.                      variable boundaries but will just scan all of memory
  10577.                      (backwards) until a blank or tab is found. If you point
  10578.                      it somewhere in a string that doesn't have any whitespace,
  10579.                      the pointer you get back will NOT be the start of the
  10580.                      string. Be careful!
  10581.      
  10582.      keywords:       pointer, previous, character, whitespace, blank, tab
  10583.      
  10584.      key sentence:   gets the pointer to the first occurrence, previous to a
  10585.                      given pointer, of a whitespace character (tab or blank)
  10586.      
  10587.      see also:       ptr< first | last | next | prev >{not}blank
  10588.                      ptr< first | last | next | prev >{not}white
  10589.      
  10590.      usage example:  compiled/executed/verified on 12/14/92
  10591.      
  10592.                      char *Astring = "This is the sample string";
  10593.                      printf("%s", ptrprevwhite(Astring + 7));
  10594.      
  10595.                       is the sample string
  10596.      
  10597.                               ┌───────────────────────┐
  10598.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10599.                               └───────────────────────┘                      */
  10600.  
  10601.  
  10602.  
  10603.  
  10604.  
  10605.  
  10606.  
  10607.  
  10608.  
  10609.                          The Hobbit House String Library               page 167
  10610.  
  10611.  
  10612.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10613.      ║ PREVWORD.C   ║   file date: 03/13/93    page   1 of   2 ║ PREVWORD.C   ║
  10614.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10615.  
  10616.      /*                       ┌───────────────────────┐             ptrprevword
  10617.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10618.                               └───────────────────────┘
  10619.                                copyright(c) 1992, 1993
  10620.      
  10621.      function:       ptrprevword (get PoinTeR to PREVious WORD)
  10622.      
  10623.      KWIC:           get the pointer to the %previous %word from a given
  10624.                      pointer
  10625.      
  10626.      syntax:         #include "hhstring.h"
  10627.                      char *ptrprevword(char *ptr)
  10628.      
  10629.      description:    scans backwards for whitespace, then scans backward
  10630.                      for non-whitespace, then scans backward for whitespace
  10631.                      again and returns the pointer to the word following that
  10632.                      whitespace. Think of it this way; given a pointer to any
  10633.                      point in a sentence, this function returns the pointer to
  10634.                      the word preceding the one pointed to. If the pointer
  10635.                      points at whitespace, this function returns the pointer to
  10636.                      the word which precedes the whitespace.
  10637.      
  10638.      returns:        a pointer to the previous word
  10639.      
  10640.      comments:       If the pointer points to the end of a string or to an EOL
  10641.                      ('\n'), the function will return a pointer to the last
  10642.                      word in the string.
  10643.      
  10644.                      If the input pointer points to the first word in a string,
  10645.                      prevword will NOT be that word but will be that word
  10646.                      preceded by all of the characters which precede it in
  10647.                      memory up to and including the previous word. Be careful!
  10648.      
  10649.      keywords:       pointer, previous, word
  10650.      
  10651.      key sentence:   gets the pointer to the word previous to the position
  10652.                      pointed to
  10653.      
  10654.      see also:       ptr< first | last | next | this | prev>word
  10655.      
  10656.  
  10657.  
  10658.  
  10659.  
  10660.  
  10661.  
  10662.  
  10663.  
  10664.  
  10665.  
  10666.  
  10667.  
  10668.  
  10669.  
  10670.      page 168            The Hobbit House String Library
  10671.  
  10672.  
  10673.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10674.      ║ PREVWORD.C   ║   file date: 03/13/93    page   2 of   2 ║ PREVWORD.C   ║
  10675.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10676.  
  10677.      
  10678.      
  10679.      usage example:  compiled/executed/verified on 12/14/92
  10680.      
  10681.                      char str[80] = "time date size other";
  10682.                      printf("\n%s", ptrprevword(str+9));
  10683.                      printf("\n%s", ptrprevword(str+13));
  10684.      
  10685.                      date size other
  10686.                      date size other
  10687.      
  10688.                               ┌───────────────────────┐
  10689.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10690.                               └───────────────────────┘                      */
  10691.  
  10692.  
  10693.  
  10694.  
  10695.  
  10696.  
  10697.  
  10698.  
  10699.  
  10700.  
  10701.  
  10702.  
  10703.  
  10704.  
  10705.  
  10706.  
  10707.  
  10708.  
  10709.  
  10710.  
  10711.  
  10712.  
  10713.  
  10714.  
  10715.  
  10716.  
  10717.  
  10718.  
  10719.  
  10720.  
  10721.  
  10722.  
  10723.  
  10724.  
  10725.  
  10726.  
  10727.  
  10728.  
  10729.  
  10730.  
  10731.                          The Hobbit House String Library               page 169
  10732.  
  10733.  
  10734.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10735.      ║ PREVWDTR.C   ║   file date: 03/13/93    page   1 of   1 ║ PREVWDTR.C   ║
  10736.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10737.  
  10738.      /*                       ┌───────────────────────┐         ptrprevwordterm
  10739.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10740.                               └───────────────────────┘
  10741.                                copyright(c) 1992, 1993
  10742.      
  10743.      function:       ptrprevwordterm (get PoinTeR to PREVious WORD TERMinator)
  10744.      
  10745.      KWIC:           get the pointer to the %previous %word terminator
  10746.      
  10747.      syntax:         #include "hhstring.h"
  10748.                      char *ptrprevwordterm(char *ptr)
  10749.      
  10750.      description:    gets a pointer to first word terminator found when
  10751.                      scanning backwards from the specified pointer. If the
  10752.                      pointer points to a word terminator, that will NOT be
  10753.                      the one pointed to upon return.
  10754.      
  10755.      returns:        a pointer to the previous word terminator
  10756.      
  10757.      comments:       note that this function skips over EVERYTHING except
  10758.                      word terminators which means that it will not stop at
  10759.                      string boundaries but will just scan all of memory
  10760.                      (backwards) until a word terminator is found. If you
  10761.                      point it somewhere in a string that doesn't have any
  10762.                      preceding word terminators, the pointer you get back
  10763.                      will NOT be the start of the string, but will most likely
  10764.                      be a pointer to the string terminator of the previous
  10765.                      string in memory. Be careful!
  10766.      
  10767.      keywords:       pointer, previous, character, word, terminator
  10768.      
  10769.      key sentence:   gets the pointer to the first occurrence, previous to a
  10770.                      given pointer, of a word terminator
  10771.      
  10772.      see also:       ptr< first | last | next | prev >wordterm
  10773.      
  10774.      usage example:  compiled/executed/verified on 1/31/93
  10775.      
  10776.                      char *Astring = "This is the Sample string";
  10777.                      printf("%s", ptrprevwordterm(Astring + 7));
  10778.      
  10779.                       is the Sample string
  10780.      
  10781.                               ┌───────────────────────┐
  10782.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10783.                               └───────────────────────┘                      */
  10784.  
  10785.  
  10786.  
  10787.  
  10788.  
  10789.  
  10790.  
  10791.  
  10792.      page 170            The Hobbit House String Library
  10793.  
  10794.  
  10795.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10796.      ║ THISTEXT.C   ║   file date: 03/13/93    page   1 of   1 ║ THISTEXT.C   ║
  10797.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10798.  
  10799.      /*                       ┌───────────────────────┐             ptrthistext
  10800.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10801.                               └───────────────────────┘
  10802.                                copyright(c) 1992, 1993
  10803.      
  10804.      function:       ptrthistext (get PoinTeR to THIS TEXT)
  10805.      
  10806.      KWIC:           get the pointer to the beginning of the %text word pointed
  10807.                      to, regardless of what character in the word is pointed to
  10808.      
  10809.      syntax:         #include "hhstring.h"
  10810.                      char *ptrthistext(char *ptr)
  10811.      
  10812.      description:    scans backward until whitespace is encountered and then
  10813.                      returns the pointer to the character following the
  10814.                      whitespace. If the input pointer points at whitespace or
  10815.                      a string terminator, then the return will be NULL.
  10816.      
  10817.      returns:        a pointer to the text word
  10818.      
  10819.      comments:       If the input pointer points to the first text word in a
  10820.                      string, the pointer returned will almost certainly NOT
  10821.                      point to that text word but will point to that text word
  10822.                      preceded by all of the non-text-terminator characters
  10823.                      which precede it in memory.
  10824.      
  10825.      keywords:       pointer, this, text, word
  10826.      
  10827.      key sentence:   gets the pointer to the beginning of the text word pointed
  10828.                      to, regardless of what character in the word is pointed to
  10829.      
  10830.      see also:       ptr< first | last | next | this | prev>text
  10831.      
  10832.      usage example:  compiled/executed/verified on 2/21/93
  10833.      
  10834.                      char string[80] = "time date size other";
  10835.                      printf("\n%s", ptrthistext(string+5));
  10836.                      printf("\n%s", ptrthistext(string+8));
  10837.      
  10838.                      date size other
  10839.                      date size other
  10840.      
  10841.                               ┌───────────────────────┐
  10842.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10843.                               └───────────────────────┘                      */
  10844.  
  10845.  
  10846.  
  10847.  
  10848.  
  10849.  
  10850.  
  10851.  
  10852.  
  10853.                          The Hobbit House String Library               page 171
  10854.  
  10855.  
  10856.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10857.      ║ THISWORD.C   ║   file date: 03/13/93    page   1 of   1 ║ THISWORD.C   ║
  10858.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10859.  
  10860.      /*                       ┌───────────────────────┐             ptrthisword
  10861.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10862.                               └───────────────────────┘
  10863.                                copyright(c) 1992, 1993
  10864.      
  10865.      function:       ptrthisword (get PoinTeR to THIS WORD)
  10866.      
  10867.      KWIC:           get the pointer to the beginning of the %word pointed to,
  10868.                      regardless of what character in the word is pointed to
  10869.      
  10870.      syntax:         #include "hhstring.h"
  10871.                      char *ptrthisword(char *ptr)
  10872.      
  10873.      description:    scans backward until whitespace is encountered and then
  10874.                      returns the pointer to the character following the
  10875.                      whitespace. If the input pointer points at whitespace or
  10876.                      a string terminator, then the return will be NULL.
  10877.      
  10878.      returns:        a pointer to the word
  10879.      
  10880.      comments:       If the input pointer points to the first word in a string,
  10881.                      the pointer returned will almost certainly NOT point to
  10882.                      that word but will point to that word preceded by all of
  10883.                      the non-whitespace characters which precede it in memory.
  10884.      
  10885.      keywords:       pointer, this, word
  10886.      
  10887.      key sentence:   gets the pointer to the beginning of the word pointed to,
  10888.                      regardless of what character in the word is pointed to
  10889.                      
  10890.      see also:       ptr< first | last | next | this | prev>word
  10891.      
  10892.      usage example:  compiled/executed/verified on 12/13/92
  10893.      
  10894.                      char string[80] = "time date size other";
  10895.                      printf("\n%s", ptrthisword(string+5));
  10896.                      printf("\n%s", ptrthisword(string+8));
  10897.      
  10898.                      date size other
  10899.                      date size other
  10900.      
  10901.                               ┌───────────────────────┐
  10902.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10903.                               └───────────────────────┘                      */
  10904.  
  10905.  
  10906.  
  10907.  
  10908.  
  10909.  
  10910.  
  10911.  
  10912.  
  10913.  
  10914.      page 172            The Hobbit House String Library
  10915.  
  10916.  
  10917.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10918.      ║ BLANK.C      ║   file date: 03/13/93    page   1 of   1 ║ BLANK.C      ║
  10919.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10920.  
  10921.      /*                       ┌───────────────────────┐                strblank
  10922.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10923.                               └───────────────────────┘
  10924.                                copyright(c) 1992, 1993
  10925.      
  10926.      function:       strblank (STRing, set to all BLANKs)
  10927.      
  10928.      KWIC:           set a string to all %blanks
  10929.      
  10930.      syntax:         #include "hhstring.h"
  10931.                      char *strblank(char *instring)
  10932.      
  10933.      description:    takes a string which has a terminating '\0' and fills it
  10934.                      with blanks, leaving the terminating zero in place.
  10935.      
  10936.      returns:        a pointer to the string
  10937.      
  10938.      comments:       this is a macro, defined in hhstring as:
  10939.      
  10940.                      #define strblank(s)     strset(s, ' ')
  10941.      
  10942.      keywords:       string, character, set, blank
  10943.      
  10944.      key sentence:   sets a string to all blanks
  10945.      
  10946.      see also:       str< blank | eos | set | zero >
  10947.      
  10948.      usage example:  compiled/executed/verified on 12/13/92
  10949.      
  10950.                      char *instring = "this string";
  10951.                      strblank(instring);
  10952.                      printf("%s%d", instring, strlen(instring));
  10953.      
  10954.                                 11
  10955.      
  10956.      
  10957.                               ┌───────────────────────┐
  10958.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  10959.                               └───────────────────────┘                      */
  10960.  
  10961.  
  10962.  
  10963.  
  10964.  
  10965.  
  10966.  
  10967.  
  10968.  
  10969.  
  10970.  
  10971.  
  10972.  
  10973.  
  10974.  
  10975.                          The Hobbit House String Library               page 173
  10976.  
  10977.  
  10978.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  10979.      ║ BLK2TAB.C    ║   file date: 03/13/93    page   1 of   2 ║ BLK2TAB.C    ║
  10980.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  10981.  
  10982.      /*                       ┌───────────────────────┐           strblanktotab
  10983.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  10984.                               └───────────────────────┘
  10985.                                copyright(c) 1992, 1993
  10986.      
  10987.      function:       strblanktotab (STRing BLANKs TO TAB compression)
  10988.      
  10989.      KWIC:           compress excess %blanks to %TAB characters
  10990.      
  10991.      syntax:         #include "hhstring.h"
  10992.                      char *strblanktotab(char *inpline, int tabspace)
  10993.      
  10994.      description:    long strings of blanks are compressed to TAB characters.
  10995.                      How many spaces are compressed depends on the tabspace.
  10996.                      A few blanks just before a tabspace boundary will also be
  10997.                      compressed.
  10998.      
  10999.      returns:        a pointer to the string
  11000.      
  11001.      comments:       (1) The string pointed to by the return value of this
  11002.                          function is in the calling function's space. The
  11003.                          return value is provided as a convenience, not a
  11004.                          necessity.
  11005.                      (2) It may see strange, at first glance, that the input
  11006.                          line first has all existing tabs removed before tabs
  11007.                          are added. This is quite necessary, however, to
  11008.                          assure proper operation of the program in all cases.
  11009.      
  11010.      keywords:       string, blank, tab, convert
  11011.      
  11012.      key sentence:   compresses blanks to a specified tab spacing (including
  11013.                                                                          string
  11014.                      inside quotes, so be careful)
  11015.      
  11016.      see also:       strtabtoblank   strblanktotab
  11017.      
  11018.      usage example:  compiled/executed/verified on 2/21/93
  11019.      
  11020.                      int ii;
  11021.                      char Astring[80];
  11022.      
  11023.                      strcpy(Astring, "This    is  the      sample     line");
  11024.                      printf("\n\n%s", Astring);
  11025.                      strblanktotab(Astring, 8);
  11026.                      printf("\n12345678901234567890123456789012345678\n");
  11027.                      for (ii = 0; ii < strlen(Astring); ii++)
  11028.                        putch(Astring[ii]);
  11029.      
  11030.                      strcpy(Astring, "This    is  the      sample     line");
  11031.                      printf("\n\n%s", Astring);
  11032.                      strblanktotab(Astring, 4);
  11033.                      printf("\n12345678901234567890123456789012345678\n");
  11034.                      for (ii = 0; ii < strlen(Astring); ii++)
  11035.  
  11036.      page 174            The Hobbit House String Library
  11037.  
  11038.  
  11039.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11040.      ║ BLK2TAB.C    ║   file date: 03/13/93    page   2 of   2 ║ BLK2TAB.C    ║
  11041.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11042.  
  11043.                        putch(Astring[ii]);
  11044.      
  11045.      
  11046.                      [NOTE: in the following "printout", the ^ represents a
  11047.                                                                            TAB]
  11048.      
  11049.                      This    is  the      sample     line
  11050.                      12345678901234567890123456789012345678
  11051.                      This^is  the^     sample^line
  11052.      
  11053.                      This    is  the      sample     line
  11054.                      12345678901234567890123456789012345678
  11055.                      This^is^the^^ sample^^line
  11056.      
  11057.                               ┌───────────────────────┐
  11058.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  11059.                               └───────────────────────┘                      */
  11060.  
  11061.  
  11062.  
  11063.  
  11064.  
  11065.  
  11066.  
  11067.  
  11068.  
  11069.  
  11070.  
  11071.  
  11072.  
  11073.  
  11074.  
  11075.  
  11076.  
  11077.  
  11078.  
  11079.  
  11080.  
  11081.  
  11082.  
  11083.  
  11084.  
  11085.  
  11086.  
  11087.  
  11088.  
  11089.  
  11090.  
  11091.  
  11092.  
  11093.  
  11094.  
  11095.  
  11096.  
  11097.                          The Hobbit House String Library               page 175
  11098.  
  11099.  
  11100.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11101.      ║ CENTER.C     ║   file date: 03/13/93    page   1 of   2 ║ CENTER.C     ║
  11102.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11103.  
  11104.      /*                       ┌───────────────────────┐               strcenter
  11105.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  11106.                               └───────────────────────┘
  11107.                                copyright(c) 1992, 1993
  11108.      
  11109.      function:       strcenter (STRing CENTER)
  11110.      
  11111.      KWIC:           %center a string
  11112.      
  11113.      syntax:         #include "hhstring.h"
  11114.                      char *strcenter(char *instring)
  11115.      
  11116.      description:    evens out the blanks around a string so that the non-blank
  11117.                      text is centered. TABs are treated as non-blank
  11118.                      characters, so this function is not necessarily useful for
  11119.                      strings with leading and/or trailing TABs (the function
  11120.                      strtabtoblank can be used to expand TABs prior to
  11121.                      centering and the function strblanktotab can be used to
  11122.                      replace excess blanks with TABs after centering).
  11123.      
  11124.      returns:        a pointer to the string
  11125.      
  11126.      comments:       this function assumes that the input string contains
  11127.                      whitespace on one or both sides but there is no problem
  11128.                      if it doesn't. If there is no whitespace at all, this
  11129.                      function does nothing.
  11130.      
  11131.                      The string pointed to by the return value of this function
  11132.                      is in the calling function's space. The return value is
  11133.                      provided as a convenience, not a necessity.
  11134.      
  11135.      keywords:       string, center, justify
  11136.      
  11137.      key sentence:   centers a string
  11138.      
  11139.      see also:       str< lf | rt >just{new}         strcenter{n}{new}
  11140.      
  11141.  
  11142.  
  11143.  
  11144.  
  11145.  
  11146.  
  11147.  
  11148.  
  11149.  
  11150.  
  11151.  
  11152.  
  11153.  
  11154.  
  11155.  
  11156.  
  11157.  
  11158.      page 176            The Hobbit House String Library
  11159.  
  11160.  
  11161.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11162.      ║ CENTER.C     ║   file date: 03/13/93    page   2 of   2 ║ CENTER.C     ║
  11163.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11164.  
  11165.      
  11166.      
  11167.      usage example:  compiled/executed/verified on 12/13/92
  11168.      
  11169.              char *Astring = "  2 left blanks, 11 right blanks           ";
  11170.              char *Bstring = "            12 left blanks,  0 right blanks";
  11171.              strcenter(Astring);
  11172.              strcenter(Bstring);
  11173.              printf("\n-->%s<--\n-->%s<--", Astring, Bstring);
  11174.      
  11175.              -->       2 left blanks, 11 right blanks      <--
  11176.              -->      12 left blanks,  0 right blanks      <--
  11177.      
  11178.                               ┌───────────────────────┐
  11179.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  11180.                               └───────────────────────┘                      */
  11181.  
  11182.  
  11183.  
  11184.  
  11185.  
  11186.  
  11187.  
  11188.  
  11189.  
  11190.  
  11191.  
  11192.  
  11193.  
  11194.  
  11195.  
  11196.  
  11197.  
  11198.  
  11199.  
  11200.  
  11201.  
  11202.  
  11203.  
  11204.  
  11205.  
  11206.  
  11207.  
  11208.  
  11209.  
  11210.  
  11211.  
  11212.  
  11213.  
  11214.  
  11215.  
  11216.  
  11217.  
  11218.  
  11219.                          The Hobbit House String Library               page 177
  11220.  
  11221.  
  11222.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11223.      ║ CENTERN.C    ║   file date: 03/13/93    page   1 of   2 ║ CENTERN.C    ║
  11224.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11225.  
  11226.      /*                       ┌───────────────────────┐              strcentern
  11227.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  11228.                               └───────────────────────┘
  11229.                                copyright(c) 1992, 1993
  11230.      
  11231.      function:       strcentern (STRing CENTER to N-char size)
  11232.      
  11233.      KWIC:           %center a string and force it to a specified %size
  11234.      
  11235.      syntax:         #include "hhstring.h"
  11236.                      char *strcentern(char *instring, int width)
  11237.      
  11238.      description:    evens out the blanks around a string so that the non-blank
  11239.                      text is centered, while at the same time setting the total
  11240.                      string size (including blanks) to the specified width.
  11241.      
  11242.      returns:        a pointer to the string;
  11243.      
  11244.      comments:       this function assumes that the input string contains
  11245.                      whitespace on one or both sides but there is no problem
  11246.                      if it doesn't. If there is no whitespace at all, this
  11247.                      function does nothing.
  11248.      
  11249.                      The string pointed to by the return value of this function
  11250.                      is in the calling function's space. The return value is
  11251.                      provided as a convenience, not a necessity.
  11252.      
  11253.      keywords:       string, center, size, justify, truncate
  11254.      
  11255.      key sentence:   centers a string and forces it to a specified width
  11256.      
  11257.      see also:       str< lf | rt >just{new}         strcenter{n}{new}
  11258.      
  11259.  
  11260.  
  11261.  
  11262.  
  11263.  
  11264.  
  11265.  
  11266.  
  11267.  
  11268.  
  11269.  
  11270.  
  11271.  
  11272.  
  11273.  
  11274.  
  11275.  
  11276.  
  11277.  
  11278.  
  11279.  
  11280.      page 178            The Hobbit House String Library
  11281.  
  11282.  
  11283.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11284.      ║ CENTERN.C    ║   file date: 03/13/93    page   2 of   2 ║ CENTERN.C    ║
  11285.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11286.  
  11287.      
  11288.      
  11289.      usage example:  compiled/executed/verified on 12/13/92
  11290.      
  11291.                      char Astring[80] = "                           string #1";
  11292.                      char Bstring[80] = "string #2";
  11293.                      strcentern(Astring, 13);
  11294.                      strcentern(Bstring, 13);
  11295.                      printf("-->%s<--\n-->%s<--", Astring, Bstring);
  11296.      
  11297.                      -->  string #1  <--
  11298.                      -->  string #2  <--
  11299.      
  11300.                               ┌───────────────────────┐
  11301.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  11302.                               └───────────────────────┘                      */
  11303.  
  11304.  
  11305.  
  11306.  
  11307.  
  11308.  
  11309.  
  11310.  
  11311.  
  11312.  
  11313.  
  11314.  
  11315.  
  11316.  
  11317.  
  11318.  
  11319.  
  11320.  
  11321.  
  11322.  
  11323.  
  11324.  
  11325.  
  11326.  
  11327.  
  11328.  
  11329.  
  11330.  
  11331.  
  11332.  
  11333.  
  11334.  
  11335.  
  11336.  
  11337.  
  11338.  
  11339.  
  11340.  
  11341.                          The Hobbit House String Library               page 179
  11342.  
  11343.  
  11344.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11345.      ║ CENTERW.C    ║   file date: 03/13/93    page   1 of   2 ║ CENTERW.C    ║
  11346.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11347.  
  11348.      /*                       ┌───────────────────────┐            strcenternew
  11349.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  11350.                               └───────────────────────┘
  11351.                                copyright(c) 1992, 1993
  11352.      
  11353.      function:       strcenternew (STRing CENTER to NEW string)
  11354.      
  11355.      KWIC:           %center a string
  11356.      
  11357.      syntax:         #include "hhstring.h"
  11358.                      char *strcenternew(char *newstring, char *instring)
  11359.      
  11360.      description:    evens out the blanks around a string so that the non-blank
  11361.                      text is centered. TABs are treated as non-blank
  11362.                                                                     characters,
  11363.                      so this function is not necessarily useful for strings
  11364.                                                                            with
  11365.                      leading and/or trailing TABs. The result is created in the
  11366.                      new string with the input string being left untouched.
  11367.      
  11368.      returns:        a pointer to the new string
  11369.      
  11370.      comments:       this function assumes that the input string contains
  11371.                      whitespace on one or both sides but there is no problem
  11372.                      if it doesn't. If there is no whitespace at all, this
  11373.                      function just moves instring to newstring.
  11374.      
  11375.                      The string pointed to by the return value of this function
  11376.                      is in the calling function's space. The return value is
  11377.                      provided as a convenience, not a necessity.
  11378.      
  11379.                      Setting newstring = instring will not work with this
  11380.                      function and overlapping newstring/instring may or may
  11381.                      not work so if you must overlap, do it cautiously.
  11382.      
  11383.      keywords:       string, center, justify, new
  11384.      
  11385.      key sentence:   centers a string and puts the result in a new string
  11386.      
  11387.      see also:       str< lf | rt >just{new}         strcenter{n}{new}
  11388.      
  11389.  
  11390.  
  11391.  
  11392.  
  11393.  
  11394.  
  11395.  
  11396.  
  11397.  
  11398.  
  11399.  
  11400.  
  11401.  
  11402.      page 180            The Hobbit House String Library
  11403.  
  11404.  
  11405.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11406.      ║ CENTERW.C    ║   file date: 03/13/93    page   2 of   2 ║ CENTERW.C    ║
  11407.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11408.  
  11409.      
  11410.      
  11411.      usage example:  compiled/executed/verified on 12/13/92
  11412.      
  11413.              char *Astring = "  2 left blanks, 11 right blanks           ";
  11414.              char *Bstring = "            12 left blanks,  0 right blanks";
  11415.              char Cstring[80];
  11416.              char Dstring[80];
  11417.              strcenternew(Cstring, Astring);
  11418.              strcenternew(Dstring, Bstring);
  11419.              printf("\n-->%s<--\n-->%s<--", Cstring, Dstring);
  11420.      
  11421.              -->       2 left blanks, 11 right blanks      <--
  11422.              -->      12 left blanks,  0 right blanks      <--
  11423.                               ┌───────────────────────┐
  11424.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  11425.                               └───────────────────────┘                      */
  11426.  
  11427.  
  11428.  
  11429.  
  11430.  
  11431.  
  11432.  
  11433.  
  11434.  
  11435.  
  11436.  
  11437.  
  11438.  
  11439.  
  11440.  
  11441.  
  11442.  
  11443.  
  11444.  
  11445.  
  11446.  
  11447.  
  11448.  
  11449.  
  11450.  
  11451.  
  11452.  
  11453.  
  11454.  
  11455.  
  11456.  
  11457.  
  11458.  
  11459.  
  11460.  
  11461.  
  11462.  
  11463.                          The Hobbit House String Library               page 181
  11464.  
  11465.  
  11466.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11467.      ║ CENTERNW.C   ║   file date: 03/13/93    page   1 of   2 ║ CENTERNW.C   ║
  11468.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11469.  
  11470.      /*                       ┌───────────────────────┐           strcenternnew
  11471.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  11472.                               └───────────────────────┘
  11473.                                copyright(c) 1992, 1993
  11474.      
  11475.      function:       strcenternnew (STRing, CENTER, to N-chars, to NEW)
  11476.      
  11477.      KWIC:           %center a string and force it to a specified %size
  11478.      
  11479.      syntax:         #include "hhstring.h"
  11480.                      char *strcenternnew(char *newstring, char *instring,
  11481.                                          int width)
  11482.      
  11483.      description:    evens out the blanks around a string so that the non-blank
  11484.                      text is centered, while at the same time setting the total
  11485.                      string size (including blanks) to the specified width and
  11486.                      putting the result into newstring.
  11487.      
  11488.      returns:        a pointer to the new string;
  11489.      
  11490.      comments:       this function assumes that the input string contains
  11491.                      whitespace on one or both sides but there is no problem
  11492.                      if it doesn't. If there is no whitespace at all, this
  11493.                      function does nothing.
  11494.      
  11495.                      The string pointed to by the return value of this function
  11496.                      is in the calling function's space. The return value is
  11497.                      provided as a convenience, not a necessity.
  11498.      
  11499.                      Setting newstring = instring does not work with this
  11500.                      function and overlapping newstring/instring may or may not
  11501.                      work so if you must overlap, do it cautiously.
  11502.      
  11503.      keywords:       string, center, justify, size, new, truncate
  11504.      
  11505.      key sentence:   centers a string and forces it to a specified width and
  11506.                      puts the result into a new string
  11507.      
  11508.      see also:       str< lf | rt >just{new}         strcenter{n}{new}
  11509.      
  11510.  
  11511.  
  11512.  
  11513.  
  11514.  
  11515.  
  11516.  
  11517.  
  11518.  
  11519.  
  11520.  
  11521.  
  11522.  
  11523.  
  11524.      page 182            The Hobbit House String Library
  11525.  
  11526.  
  11527.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11528.      ║ CENTERNW.C   ║   file date: 03/13/93    page   2 of   2 ║ CENTERNW.C   ║
  11529.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11530.  
  11531.      
  11532.      
  11533.      usage example:  compiled/executed/verified on 12/13/92
  11534.      
  11535.                      char *Astring = "                           string #1";
  11536.                      char *Bstring = "string #2";
  11537.                      char Cstring[20];
  11538.                      strcenternnew(Cstring, Astring, 13);
  11539.                      printf("\n-->%s<--", Cstring);
  11540.                      strcenternnew(Cstring, Bstring, 13);
  11541.                      printf("\n-->%s<--", Cstring);
  11542.      
  11543.                      -->  string #1  <--
  11544.                      -->  string #2  <--
  11545.      
  11546.                               ┌───────────────────────┐
  11547.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  11548.                               └───────────────────────┘                      */
  11549.  
  11550.  
  11551.  
  11552.  
  11553.  
  11554.  
  11555.  
  11556.  
  11557.  
  11558.  
  11559.  
  11560.  
  11561.  
  11562.  
  11563.  
  11564.  
  11565.  
  11566.  
  11567.  
  11568.  
  11569.  
  11570.  
  11571.  
  11572.  
  11573.  
  11574.  
  11575.  
  11576.  
  11577.  
  11578.  
  11579.  
  11580.  
  11581.  
  11582.  
  11583.  
  11584.  
  11585.                          The Hobbit House String Library               page 183
  11586.  
  11587.  
  11588.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11589.      ║ CKSUMA.C     ║   file date: 03/13/93    page   1 of   1 ║ CKSUMA.C     ║
  11590.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11591.  
  11592.      /*                       ┌───────────────────────┐            strchecksuma
  11593.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  11594.                               └───────────────────────┘
  11595.                                copyright(c) 1992, 1993
  11596.      
  11597.      function:       strchecksuma (STRing, get CHECKSUM, Arithmetic)
  11598.      
  11599.      KWIC:           computes the %arithmetic %checksum of a string.
  11600.      
  11601.      syntax:         #include "hhstring.h"
  11602.                      unsigned long strchecksuma(char *instring)
  11603.      
  11604.      description:    an arithmetic checksum is taken on instring
  11605.      
  11606.      returns:        the arithmetic checksum of the input string
  11607.      
  11608.      comments:       Note that a long result is used so as to provide a
  11609.                      substantially more reliable result than is provided by the
  11610.                      original mag-tape checksum concept (circa 1955) in which
  11611.                      the checksum of a string of bytes was a byte (the "sum"
  11612.                      was actually an exclusive-or of the bytes). In other
  11613.                      words, this function gives an arithmetic sum, not a
  11614.                      logical checksum.
  11615.      
  11616.      keywords:       string, checksum, arithmetic
  11617.      
  11618.      key sentence:   computes the arithmetic checksum of a string
  11619.      
  11620.      see also:       strchecksum{i}< a | l >
  11621.      
  11622.      usage example:  compiled/executed/verified on 12/20/92
  11623.      
  11624.                      char *Astring = "This is the Sample string";
  11625.                      printf("%d", strchecksuma(Astring));
  11626.      
  11627.                      2350
  11628.      
  11629.                               ┌───────────────────────┐
  11630.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  11631.                               └───────────────────────┘                      */
  11632.  
  11633.  
  11634.  
  11635.  
  11636.  
  11637.  
  11638.  
  11639.  
  11640.  
  11641.  
  11642.  
  11643.  
  11644.  
  11645.  
  11646.      page 184            The Hobbit House String Library
  11647.  
  11648.  
  11649.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11650.      ║ CKSUMIA.C    ║   file date: 03/13/93    page   1 of   1 ║ CKSUMIA.C    ║
  11651.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11652.  
  11653.      /*                       ┌───────────────────────┐           strchecksumia
  11654.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  11655.                               └───────────────────────┘
  11656.                                copyright(c) 1992, 1993
  11657.      
  11658.      function:       strchecksumia (STRing, get CHECKSUM, case-Independant,
  11659.                                      Arithmetic)
  11660.      
  11661.      KWIC:           computes the %arithmetic %checksum of a string %indpendant
  11662.                      of case
  11663.      
  11664.      syntax:         #include "hhstring.h"
  11665.                      unsigned long strchecksumia(char *instring);
  11666.      
  11667.      description:    an arithmetic checksum is taken on instring with each
  11668.                      character being converted to upper case before the
  11669.                      checksum is taken
  11670.      
  11671.      returns:        the arithmetic checksum of the input string (taken as
  11672.                      being case independent)
  11673.      
  11674.      comments:       Note that a long result is used so as to provide a
  11675.                      substantially more reliable result than is provided by the
  11676.                      original mag-tape checksum concept (circa 1955) in which
  11677.                      the checksum of a string of bytes was a byte (the "sum"
  11678.                      was actually an exclusive-or of the bytes). In other
  11679.                      words, this function gives an arithmetic sum, not a
  11680.                      logical checksum.
  11681.      
  11682.      keywords:       string, checksum, arithmetic, case-independent
  11683.      
  11684.      key sentence:   computes the arithmetic checksum of a string, independent
  11685.                      of case
  11686.      
  11687.      see also:       strchecksum{i}< a | l >
  11688.      
  11689.      usage example:  compiled/executed/verified on 12/20/92
  11690.      
  11691.                      char *Astring = "This is the Sample string";
  11692.                      printf("%d", strchecksumia(Astring));
  11693.      
  11694.                      1742
  11695.      
  11696.                               ┌───────────────────────┐
  11697.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  11698.                               └───────────────────────┘                      */
  11699.  
  11700.  
  11701.  
  11702.  
  11703.  
  11704.  
  11705.  
  11706.  
  11707.                          The Hobbit House String Library               page 185
  11708.  
  11709.  
  11710.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11711.      ║ CKSUMIL.C    ║   file date: 03/13/93    page   1 of   1 ║ CKSUMIL.C    ║
  11712.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11713.  
  11714.      /*                       ┌───────────────────────┐           strchecksumil
  11715.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  11716.                               └───────────────────────┘
  11717.                                copyright(c) 1992, 1993
  11718.      
  11719.      function:       strchecksumil (STRing, get CHECKSUM, case-Independant,
  11720.                                      Logical)
  11721.      
  11722.      KWIC:           computes the %logical %checksum of a string, %independant
  11723.                      of case
  11724.      
  11725.      syntax:         #include "hhstring.h"
  11726.                      unsigned char strchecksumil(char *instring)
  11727.      
  11728.      description:    a logical checksum is taken on instring, with each
  11729.                      character being converted to upper case before the
  11730.                      checksum is taken
  11731.      
  11732.      returns:        the logical checksum of the input string (taken as a
  11733.                      case-independent string)
  11734.      
  11735.      comments:       Note that this function is based on the original concept
  11736.                      of a checksum as the exclusive-or of string of bytes. This
  11737.                      concept, (circa 1955) is much less reliable than the
  11738.                      arithmetic checksum provided by the functions
  11739.                      strchecksuma and strchecksumia.
  11740.      
  11741.      keywords:       string, checksum, logical, case-independent
  11742.      
  11743.      key sentence:   computes the logical checksum of a string, independent of
  11744.                      case
  11745.      
  11746.      see also:       strchecksum{i}< a | l >
  11747.      
  11748.      usage example:  compiled/executed/verified on 12/20/92
  11749.      
  11750.                      char *Astring = "This is the Sample string";
  11751.                      printf("%2.2x", strchecksumil(Astring));
  11752.      
  11753.                      56
  11754.      
  11755.                               ┌───────────────────────┐
  11756.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  11757.                               └───────────────────────┘                      */
  11758.  
  11759.  
  11760.  
  11761.  
  11762.  
  11763.  
  11764.  
  11765.  
  11766.  
  11767.  
  11768.      page 186            The Hobbit House String Library
  11769.  
  11770.  
  11771.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11772.      ║ CKSUML.C     ║   file date: 03/13/93    page   1 of   1 ║ CKSUML.C     ║
  11773.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11774.  
  11775.      /*                       ┌───────────────────────┐            strchecksuml
  11776.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  11777.                               └───────────────────────┘
  11778.                                copyright(c) 1992, 1993
  11779.      
  11780.      function:       strchecksuml (STRing, get CHECKSUM, Logical)
  11781.      
  11782.      KWIC:           computes the %logical %checksum of a string.
  11783.      
  11784.      syntax:         #include "hhstring.h"
  11785.                      unsigned char strchecksuml(char *instring);
  11786.      
  11787.      description:    a logical checksum is taken on instring
  11788.      
  11789.      returns:        the logical checksum of the input string
  11790.      
  11791.      comments:       Note that this function is based on the original concept
  11792.                      of a checksum as the exclusive-or of string of bytes. This
  11793.                      concept, (circa 1955) is much less reliable than the
  11794.                      arithmetic checksum provided by the function strchecksuma.
  11795.      
  11796.      keywords:       string, checksum, logical
  11797.      
  11798.      key sentence:   computes the logical checksum of a string
  11799.      
  11800.      see also:       strchecksum{i}< a | l >
  11801.      
  11802.      usage example:  compiled/executed/verified on 12/20/92
  11803.      
  11804.                      char *Astring = "This is the Sample string";
  11805.                      printf("%2.2x", strchecksuml(Astring));
  11806.      
  11807.                      76
  11808.      
  11809.                               ┌───────────────────────┐
  11810.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  11811.                               └───────────────────────┘                      */
  11812.  
  11813.  
  11814.  
  11815.  
  11816.  
  11817.  
  11818.  
  11819.  
  11820.  
  11821.  
  11822.  
  11823.  
  11824.  
  11825.  
  11826.  
  11827.  
  11828.  
  11829.                          The Hobbit House String Library               page 187
  11830.  
  11831.  
  11832.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11833.      ║ CHRCNT.C     ║   file date: 03/13/93    page   1 of   1 ║ CHRCNT.C     ║
  11834.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11835.  
  11836.      /*                       ┌───────────────────────┐             strchrcount
  11837.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  11838.                               └───────────────────────┘
  11839.                                copyright(c) 1992, 1993
  11840.      
  11841.      function:       strchrcount (STRing CHaRacter COUNT of occurrences)
  11842.      
  11843.      KWIC:           return the %count of occurrences of a particular
  11844.                                                                      %character
  11845.                      in a given string
  11846.      
  11847.      syntax:         #include "hhstring.h"
  11848.                      int strchrcount(char *instring, int c)
  11849.      
  11850.      description:    instring is scanned and the occurrences of the character
  11851.                      c are counted
  11852.      
  11853.      returns:        the number of occurrences
  11854.      
  11855.      comments:       none
  11856.      
  11857.      keywords:       string, character, count
  11858.      
  11859.      key sentence:   reports the number of occurrences in a string of a
  11860.                      given character
  11861.      
  11862.      see also:       strchrcount{i}
  11863.      
  11864.      usage example:  compiled/executed/verified on 12/15/92
  11865.      
  11866.                      char *Astring = "This is The Sample String";
  11867.                      printf("%d", strchrcount(Astring, 's'));
  11868.      
  11869.                      2
  11870.      
  11871.                               ┌───────────────────────┐
  11872.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  11873.                               └───────────────────────┘                      */
  11874.  
  11875.  
  11876.  
  11877.  
  11878.  
  11879.  
  11880.  
  11881.  
  11882.  
  11883.  
  11884.  
  11885.  
  11886.  
  11887.  
  11888.  
  11889.  
  11890.      page 188            The Hobbit House String Library
  11891.  
  11892.  
  11893.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11894.      ║ CHRCNTI.C    ║   file date: 03/13/93    page   1 of   1 ║ CHRCNTI.C    ║
  11895.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11896.  
  11897.      /*                       ┌───────────────────────┐            strchrcounti
  11898.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  11899.                               └───────────────────────┘
  11900.                                copyright(c) 1992, 1993
  11901.      
  11902.      function:       strchrcounti (STRing CHaRacter, COUNT of occurrences,
  11903.                                    case-Independant)
  11904.      
  11905.      KWIC:           return the %count of occurrences, %independant of case, of
  11906.                      a %character in a given string
  11907.      
  11908.      syntax:         #include "hhstring.h"
  11909.                      int strchrcounti(char *instring, char c)
  11910.      
  11911.      description:    instring is scanned and the case-independent occurrences
  11912.                      of the character c are counted
  11913.      
  11914.      returns:        the number of occurrences
  11915.      
  11916.      comments:       none
  11917.      
  11918.      keywords:       string, character, count, case-independent
  11919.      
  11920.      key sentence:   reports the number occurrences in a string of a case-
  11921.                      independent character
  11922.      
  11923.      see also:       strchrcount{i}
  11924.      
  11925.      usage example:  compiled/executed/verified on 12/15/92
  11926.      
  11927.                      char *Astring = "This is The Sample String";
  11928.                      printf("%d", strchrcounti(Astring, 's'));
  11929.      
  11930.                      4
  11931.      
  11932.                               ┌───────────────────────┐
  11933.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  11934.                               └───────────────────────┘                      */
  11935.  
  11936.  
  11937.  
  11938.  
  11939.  
  11940.  
  11941.  
  11942.  
  11943.  
  11944.  
  11945.  
  11946.  
  11947.  
  11948.  
  11949.  
  11950.  
  11951.                          The Hobbit House String Library               page 189
  11952.  
  11953.  
  11954.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  11955.      ║ CHRDEL.C     ║   file date: 03/13/93    page   1 of   1 ║ CHRDEL.C     ║
  11956.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  11957.  
  11958.      /*                       ┌───────────────────────┐               strchrdel
  11959.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  11960.                               └───────────────────────┘
  11961.                                copyright(c) 1992, 1993
  11962.      
  11963.      function:       strchrdel (STRing CHaRacter DELete)
  11964.      
  11965.      KWIC:           %delete, from a string, all occurrences of a given
  11966.                      %character
  11967.      
  11968.      syntax:         #include "hhstring.h"
  11969.                      char *strchrdel(char *instring, char delchar)
  11970.      
  11971.      description:    all occurrences of delchar are deleted from the string
  11972.      
  11973.      returns:        a pointer to the string
  11974.      
  11975.      comments:       a delchar of binary zero ('\0') will have no effect other
  11976.                      than to waste some machine time.
  11977.      
  11978.                      The string pointed to by the return value of this function
  11979.                      is in the calling function's space. The return value is
  11980.                      provided as a convenience, not a necessity.
  11981.      
  11982.      keywords:       string, character, delete
  11983.      
  11984.      key sentence:   deletes from a string all occurrences of a given character
  11985.      
  11986.      see also:       strchrdel< {i} | range | set >{new}
  11987.      
  11988.      usage example:  compiled/executed/verified on 2/19/93
  11989.      
  11990.                      char *Astring = "Dummy string --- to show char deletion";
  11991.                      printf("\n%s", strchrdel(Astring, '-'));
  11992.                      strchrdel(Astring, ' ');
  11993.                      printf("\n%s", Astring);
  11994.      
  11995.                      Dummy string  to show char deletion
  11996.                      Dummystringtoshowchardeletion
  11997.      
  11998.                               ┌───────────────────────┐
  11999.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  12000.                               └───────────────────────┘                      */
  12001.  
  12002.  
  12003.  
  12004.  
  12005.  
  12006.  
  12007.  
  12008.  
  12009.  
  12010.  
  12011.  
  12012.      page 190            The Hobbit House String Library
  12013.  
  12014.  
  12015.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12016.      ║ CHRDELG.C    ║   file date: 03/13/93    page   1 of   1 ║ CHRDELG.C    ║
  12017.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12018.  
  12019.      /*                       ┌───────────────────────┐             strchrdelgr
  12020.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  12021.                               └───────────────────────┘
  12022.                                copyright(c) 1992, 1993
  12023.      
  12024.      function:       strchrdelgr (STRing, CHaRacter, DELete a GRoup of chars)
  12025.      
  12026.      KWIC:           %delete (from a string) all occurrences of each of a given
  12027.                      %group of characters
  12028.      
  12029.      syntax:         #include "hhstring.h"
  12030.                      char *strchrdelgr(char *instring, char *delchars)
  12031.      
  12032.      description:    all occurrences of each of the characters in delchars are
  12033.                      deleted from the string
  12034.      
  12035.      returns:        a pointer to the string
  12036.      
  12037.      comments:       a delchars character of '\0' will always be taken as the
  12038.                      terminator for the delchars string, so '\0' cannot be a
  12039.                      valid delchars character.
  12040.      
  12041.                      The string pointed to by the return value of this function
  12042.                      is in the calling function's space. The return value is
  12043.                      provided as a convenience, not a necessity.
  12044.      
  12045.      keywords:       string, character, delete, group
  12046.      
  12047.      key sentence:   deletes from a string all occurrences of any of the
  12048.                      characters in a group of characters
  12049.      
  12050.      see also:       strchrdel< {i} | range | gr >{new}
  12051.      
  12052.      usage example:  compiled/executed/verified on 2/4/93
  12053.      
  12054.                      char *Astring = "to // show \\ deletion ----";
  12055.                      printf("\n%s", strchrdelgr(Astring, "/\\"));
  12056.                      printf("\n%s", strchrdelgr(Astring, "- "));
  12057.      
  12058.                      to  show  deletion ----
  12059.                      toshowdeletion
  12060.      
  12061.                               ┌───────────────────────┐
  12062.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  12063.                               └───────────────────────┘                      */
  12064.  
  12065.  
  12066.  
  12067.  
  12068.  
  12069.  
  12070.  
  12071.  
  12072.  
  12073.                          The Hobbit House String Library               page 191
  12074.  
  12075.  
  12076.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12077.      ║ CHRDELGW.C   ║   file date: 03/13/93    page   1 of   2 ║ CHRDELGW.C   ║
  12078.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12079.  
  12080.      /*                       ┌───────────────────────┐          strchrdelgrnew
  12081.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  12082.                               └───────────────────────┘
  12083.                                copyright(c) 1992, 1993
  12084.      
  12085.      function:       strchrdelgrnew (STRing, CHaRacter, DELete a GRoup of
  12086.                                       characters to NEW string)
  12087.      
  12088.      KWIC:           %delete all occurances of any character from a %group of
  12089.                      characters
  12090.      
  12091.      syntax:         #include "hhstring.h"
  12092.                      char *strchrdelgrnew(char *newstring, char *instring,
  12093.                                            char *delchars)
  12094.      
  12095.      description:    newstring is created as instring without any occurrences
  12096.                                                                              of
  12097.                      any of the characters in delchars
  12098.      
  12099.      returns:        a pointer to newstring
  12100.      
  12101.      comments:       a delchars character of '\0' will always be taken as the
  12102.                      terminator for the delchars string, so '\0' cannot be a
  12103.                      valid delchars character.
  12104.      
  12105.                      Logically, it should not be a requirement that newstring
  12106.                      be as large as instring (one might KNOW that at least
  12107.                      SOME characters were going to get deleted) but this
  12108.                      particular implementation DOES require it.
  12109.      
  12110.                      The string pointed to by the return value of this function
  12111.                      is in the calling function's space. The return value is
  12112.                      provided as a convenience, not a necessity.
  12113.      
  12114.                      Setting newstring = instring will work OK with this
  12115.                      function but overlapping newstring/instring may or may
  12116.                      not work so if you must overlap, do it cautiously.
  12117.      
  12118.      keywords:       string, character, delete, group, new
  12119.      
  12120.      key sentence:   deletes from a string all occurrences of any of the
  12121.                      characters in a group of characters and puts the result
  12122.                      into a new string
  12123.      
  12124.      see also:       strchrdel< {i} | range | gr >{new}
  12125.      
  12126.      
  12127.  
  12128.  
  12129.  
  12130.  
  12131.  
  12132.  
  12133.  
  12134.      page 192            The Hobbit House String Library
  12135.  
  12136.  
  12137.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12138.      ║ CHRDELGW.C   ║   file date: 03/13/93    page   2 of   2 ║ CHRDELGW.C   ║
  12139.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12140.  
  12141.      
  12142.      
  12143.      usage example:  compiled/executed/verified on 2/4/93
  12144.      
  12145.                      char Astring[80] = "to // show \\ deletion ----";
  12146.                      char Bstring[80];
  12147.                      char Cstring[80];
  12148.                      strchrdelgrnew(Bstring, Astring, "/\\");
  12149.                      printf("\n%s", Bstring);
  12150.                      printf("\n%s", strchrdelgrnew(Cstring, Bstring, "- "));
  12151.      
  12152.                      to  show  deletion ----
  12153.                      toshowdeletion
  12154.      
  12155.                               ┌───────────────────────┐
  12156.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  12157.                               └───────────────────────┘                      */
  12158.  
  12159.  
  12160.  
  12161.  
  12162.  
  12163.  
  12164.  
  12165.  
  12166.  
  12167.  
  12168.  
  12169.  
  12170.  
  12171.  
  12172.  
  12173.  
  12174.  
  12175.  
  12176.  
  12177.  
  12178.  
  12179.  
  12180.  
  12181.  
  12182.  
  12183.  
  12184.  
  12185.  
  12186.  
  12187.  
  12188.  
  12189.  
  12190.  
  12191.  
  12192.  
  12193.  
  12194.  
  12195.                          The Hobbit House String Library               page 193
  12196.  
  12197.  
  12198.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12199.      ║ CHRDELI.C    ║   file date: 03/13/93    page   1 of   1 ║ CHRDELI.C    ║
  12200.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12201.  
  12202.      /*                       ┌───────────────────────┐              
  12203.                                                                      strchrdeli
  12204.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  12205.                               └───────────────────────┘
  12206.                                copyright(c) 1992, 1993
  12207.      
  12208.      function:       strchrdeli (STRing, CHaRacter, DELete, case-Independant)
  12209.      
  12210.      KWIC:           %delete, from a string, all occurrences of a given
  12211.                      %character, %independant of case
  12212.      
  12213.      syntax:         #include "hhstring.h"
  12214.                      char *strchrdeli(char *instring, char delchar)
  12215.      
  12216.      description:    all case-independent occurrences of delchar are deleted
  12217.                      from the string
  12218.      
  12219.      returns:        a pointer to the string
  12220.      
  12221.      comments:       a delchar of binary zero ('\0') will have no effect other
  12222.                      than to waste some machine time.
  12223.      
  12224.                      The string pointed to by the return value of this function
  12225.                      is in the calling function's space. The return value is
  12226.                      provided as a convenience, not a necessity.
  12227.      
  12228.      keywords:       string, character, delete, case-independent
  12229.      
  12230.      key sentence:   deletes from a string all case-independent occurrences
  12231.                      of a given character
  12232.      
  12233.      see also:       strchrdel< {i} | range | set >{new}
  12234.      
  12235.      usage example:  compiled/executed/verified on 2/25/93
  12236.      
  12237.                      char Astring[80] = "Dummy --- to show char deletion";
  12238.                      printf("\n%s", strchrdeli(Astring, '-'));
  12239.                      strchrdeli(Astring, 'd');
  12240.                      printf("\n%s", Astring);
  12241.      
  12242.                      Dummy  to show char deletion
  12243.                      ummy  to show char eletion
  12244.      
  12245.                               ┌───────────────────────┐
  12246.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  12247.                               └───────────────────────┘                      */
  12248.  
  12249.  
  12250.  
  12251.  
  12252.  
  12253.  
  12254.  
  12255.  
  12256.      page 194            The Hobbit House String Library
  12257.  
  12258.  
  12259.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12260.      ║ CHRDELIW.C   ║   file date: 03/13/93    page   1 of   2 ║ CHRDELIW.C   ║
  12261.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12262.  
  12263.      /*                       ┌───────────────────────┐           strchrdelinew
  12264.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  12265.                               └───────────────────────┘
  12266.                                copyright(c) 1992, 1993
  12267.      
  12268.      function:       strchrdelinew (STRing, CHaRacter, DELete,
  12269.                                     case-Independant, to NEW string)
  12270.      
  12271.      KWIC:           %delete all occurrences of a given %character,
  12272.                      %independant of case
  12273.      
  12274.      syntax:         #include "hhstring.h"
  12275.                      char *strchrdelinew(char *newstring, char *instring,
  12276.                                          char delchar)
  12277.      
  12278.      description:    newstring is created as instring but with all case-
  12279.                      independent occurrences of delchar having been deleted
  12280.      
  12281.      returns:        a pointer to newstring
  12282.      
  12283.      comments:       if delchar is binary zero ('\0'), newstring will equal
  12284.                      instring
  12285.      
  12286.                      The string pointed to by the return value of this function
  12287.                      is in the calling function's space. The return value is
  12288.                      provided as a convenience, not a necessity.
  12289.      
  12290.                      Setting newstring = instring will work OK with this
  12291.                      function but overlapping newstring/instring may or may
  12292.                      not work so if you must overlap, do it cautiously.
  12293.      
  12294.      keywords:       string, character, delete, case-independent, new
  12295.      
  12296.      key sentence:   deletes from a string all case-independent occurrences
  12297.                      of a given character and puts the result into a new string
  12298.      
  12299.      see also:       strchrdel< {i} | range | set >{new}
  12300.      
  12301.  
  12302.  
  12303.  
  12304.  
  12305.  
  12306.  
  12307.  
  12308.  
  12309.  
  12310.  
  12311.  
  12312.  
  12313.  
  12314.  
  12315.  
  12316.  
  12317.                          The Hobbit House String Library               page 195
  12318.  
  12319.  
  12320.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12321.      ║ CHRDELIW.C   ║   file date: 03/13/93    page   2 of   2 ║ CHRDELIW.C   ║
  12322.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12323.  
  12324.      
  12325.      
  12326.      usage example:  compiled/executed/verified on 2/25/93
  12327.      
  12328.                      char Astring[80] = "Dummy --- to show char deletion";
  12329.                      char Bstring[80];
  12330.                      char Cstring[80];
  12331.                      printf("\n%s", strchrdelinew(Bstring, Astring, '-'));
  12332.                      strchrdelinew(Cstring, Bstring, 'd');
  12333.                      printf("\n%s", Cstring);
  12334.      
  12335.                      Dummy  to show char deletion
  12336.                      ummy  to show char eletion
  12337.      
  12338.                               ┌───────────────────────┐
  12339.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  12340.                               └───────────────────────┘                      */
  12341.  
  12342.  
  12343.  
  12344.  
  12345.  
  12346.  
  12347.  
  12348.  
  12349.  
  12350.  
  12351.  
  12352.  
  12353.  
  12354.  
  12355.  
  12356.  
  12357.  
  12358.  
  12359.  
  12360.  
  12361.  
  12362.  
  12363.  
  12364.  
  12365.  
  12366.  
  12367.  
  12368.  
  12369.  
  12370.  
  12371.  
  12372.  
  12373.  
  12374.  
  12375.  
  12376.  
  12377.  
  12378.      page 196            The Hobbit House String Library
  12379.  
  12380.  
  12381.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12382.      ║ CHRDELW.C    ║   file date: 03/13/93    page   1 of   2 ║ CHRDELW.C    ║
  12383.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12384.  
  12385.      /*                       ┌───────────────────────┐            strchrdelnew
  12386.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  12387.                               └───────────────────────┘
  12388.                                copyright(c) 1992, 1993
  12389.      
  12390.      function:       strchrdelnew (STRing, CHaRacter, DELete a character to
  12391.                                    NEW string)
  12392.      
  12393.      KWIC:           %delete (from a string) all occurrences of a given
  12394.                      %character
  12395.      
  12396.      syntax:         #include "hhstring.h"
  12397.                      char *strchrdelnew(char *newstring, char *instring,
  12398.                                          char delchar)
  12399.      
  12400.      description:    newstring is created as instring but with all occurrences
  12401.                                                                              of
  12402.                      delchar having been deleted
  12403.      
  12404.      returns:        a pointer to newstring
  12405.      
  12406.      comments:       if delchar is binary zero ('\0'), newstring will equal
  12407.                      instring
  12408.      
  12409.                      The string pointed to by the return value of this function
  12410.                      is in the calling function's space. The return value is
  12411.                      provided as a convenience, not a necessity.
  12412.      
  12413.                      Setting newstring = instring will work OK with this
  12414.                      function but overlapping newstring/instring may or may
  12415.                      not work so if you must overlap, do it cautiously.
  12416.      
  12417.      keywords:       string, character, delete, new
  12418.      
  12419.      key sentence:   deletes from a string all occurrences of a given character
  12420.                      and puts the result into a new string
  12421.      
  12422.      see also:       strchrdel< {i} | range | set >{new}
  12423.      
  12424.  
  12425.  
  12426.  
  12427.  
  12428.  
  12429.  
  12430.  
  12431.  
  12432.  
  12433.  
  12434.  
  12435.  
  12436.  
  12437.  
  12438.  
  12439.                          The Hobbit House String Library               page 197
  12440.  
  12441.  
  12442.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12443.      ║ CHRDELW.C    ║   file date: 03/13/93    page   2 of   2 ║ CHRDELW.C    ║
  12444.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12445.  
  12446.      
  12447.      
  12448.      usage example:  compiled/executed/verified on 2/19/93
  12449.      
  12450.              char Astring[80] = "Dummy string --- to show char deletion";
  12451.              char Bstring[80];
  12452.              char Cstring[80];
  12453.              printf("\n%s", strchrdelnew(Bstring, Astring, '-'));
  12454.              strchrdelnew(Cstring, Bstring, ' ');
  12455.              printf("\n%s", Cstring);
  12456.      
  12457.              Dummy string  to show char deletion
  12458.              Dummystringtoshowchardeletion
  12459.      
  12460.                               ┌───────────────────────┐
  12461.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  12462.                               └───────────────────────┘                      */
  12463.  
  12464.  
  12465.  
  12466.  
  12467.  
  12468.  
  12469.  
  12470.  
  12471.  
  12472.  
  12473.  
  12474.  
  12475.  
  12476.  
  12477.  
  12478.  
  12479.  
  12480.  
  12481.  
  12482.  
  12483.  
  12484.  
  12485.  
  12486.  
  12487.  
  12488.  
  12489.  
  12490.  
  12491.  
  12492.  
  12493.  
  12494.  
  12495.  
  12496.  
  12497.  
  12498.  
  12499.  
  12500.      page 198            The Hobbit House String Library
  12501.  
  12502.  
  12503.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12504.      ║ CHRDELR.C    ║   file date: 03/13/93    page   1 of   1 ║ CHRDELR.C    ║
  12505.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12506.  
  12507.      /*                       ┌───────────────────────┐          strchrdelrange
  12508.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  12509.                               └───────────────────────┘
  12510.                                copyright(c) 1992, 1993
  12511.      
  12512.      function:       strchrdelrange (STRing, CHaRacter, DELete a RANGE of
  12513.                                      characters)
  12514.      
  12515.      KWIC:           %delete all characters in a specified %range, inclusive
  12516.      
  12517.      syntax:         #include "hhstring.h"
  12518.                      char *strchrdelrange(char *instring, char lo, char hi)
  12519.      
  12520.      description:    all of the characters in instring which fall in the range
  12521.                      from lo to hi, inclusive, are deleted from the string
  12522.      
  12523.      returns:        a pointer to the string
  12524.      
  12525.      comments:       The string pointed to by the return value of this function
  12526.                      is in the calling function's space. The return value is
  12527.                      provided as a convenience, not a necessity.
  12528.      
  12529.      keywords:       string, character, delete, range
  12530.      
  12531.      key sentence:   deletes from a string all characters in a specified range
  12532.      
  12533.      see also:       strchrdel< {i} | range | set >{new}
  12534.      
  12535.      usage example:  compiled/executed/verified on 12/15/92
  12536.      
  12537.                      char *Astring = "THIS (is) the Sample";
  12538.                      strchrdelrange(Astring, '!', 'Z');
  12539.                      printf("\n%s", Astring);
  12540.                      printf("\n%s", strchrdelrange(Astring, 'a', 'e'));
  12541.      
  12542.                       is the ample
  12543.                       is th mpl
  12544.      
  12545.                               ┌───────────────────────┐
  12546.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  12547.                               └───────────────────────┘                      */
  12548.  
  12549.  
  12550.  
  12551.  
  12552.  
  12553.  
  12554.  
  12555.  
  12556.  
  12557.  
  12558.  
  12559.  
  12560.  
  12561.                          The Hobbit House String Library               page 199
  12562.  
  12563.  
  12564.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12565.      ║ CHRDELRW.C   ║   file date: 03/13/93    page   1 of   2 ║ CHRDELRW.C   ║
  12566.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12567.  
  12568.      /*                       ┌───────────────────────┐       strchrdelrangenew
  12569.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  12570.                               └───────────────────────┘
  12571.                                copyright(c) 1992, 1993
  12572.      
  12573.      function:       strchrdelrangenew (STRing, CHaRacter, DELete a RANGE of
  12574.                                         characters to a NEW string)
  12575.      
  12576.      KWIC:           %delete all characters in a specified %range, inclusive
  12577.      
  12578.      syntax:         #include "hhstring.h"
  12579.                      char *strchrdelrangenew(char *newstring, char *instring,
  12580.                                        char lo, char hi)
  12581.      
  12582.      description:    all of the characters in instring which fall in the range
  12583.                      from lo to hi, inclusive, are deleted from the string
  12584.                      while the string is otherwise copied to newstring
  12585.      
  12586.      returns:        a pointer to the new string
  12587.      
  12588.      comments:       The string pointed to by the return value of this function
  12589.                      is in the calling function's space. The return value is
  12590.                      provided as a convenience, not a necessity.
  12591.      
  12592.                      Setting newstring = instring will work OK with this
  12593.                      function but overlapping newstring/instring may or may
  12594.                      not work so if you must overlap, do it cautiously.
  12595.      
  12596.      keywords:       string, character, delete, range, new
  12597.      
  12598.      key sentence:   deletes from a string all characters in a specified
  12599.                      range of characters and puts the result into a new string
  12600.      
  12601.      see also:       strchrdel< {i} | range | set >{new}
  12602.      
  12603.  
  12604.  
  12605.  
  12606.  
  12607.  
  12608.  
  12609.  
  12610.  
  12611.  
  12612.  
  12613.  
  12614.  
  12615.  
  12616.  
  12617.  
  12618.  
  12619.  
  12620.  
  12621.  
  12622.      page 200            The Hobbit House String Library
  12623.  
  12624.  
  12625.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12626.      ║ CHRDELRW.C   ║   file date: 03/13/93    page   2 of   2 ║ CHRDELRW.C   ║
  12627.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12628.  
  12629.      
  12630.      
  12631.      usage example:  compiled/executed/verified on 12/15/92
  12632.      
  12633.                      char *Astring = "THIS (is) the Sample";
  12634.                      char Bstring[80];
  12635.                      strchrdelrangenew(Bstring, Astring, '!', 'Z');
  12636.                      printf("\n%s", Bstring);
  12637.                      printf("\n%s", strchrdelrangenew(Bstring,
  12638.                                              Astring, 'a', 'e'));
  12639.      
  12640.                       is the ample
  12641.                      THIS (is) th Smpl
  12642.      
  12643.                               ┌───────────────────────┐
  12644.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  12645.                               └───────────────────────┘                      */
  12646.  
  12647.  
  12648.  
  12649.  
  12650.  
  12651.  
  12652.  
  12653.  
  12654.  
  12655.  
  12656.  
  12657.  
  12658.  
  12659.  
  12660.  
  12661.  
  12662.  
  12663.  
  12664.  
  12665.  
  12666.  
  12667.  
  12668.  
  12669.  
  12670.  
  12671.  
  12672.  
  12673.  
  12674.  
  12675.  
  12676.  
  12677.  
  12678.  
  12679.  
  12680.  
  12681.  
  12682.  
  12683.                          The Hobbit House String Library               page 201
  12684.  
  12685.  
  12686.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12687.      ║ CHRFROMC.C   ║   file date: 03/13/93    page   1 of   2 ║ CHRFROMC.C   ║
  12688.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12689.  
  12690.      /*                       ┌───────────────────────┐             strchrfromc
  12691.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  12692.                               └───────────────────────┘
  12693.                                copyright(c) 1992, 1993
  12694.      
  12695.      function:       strchrfromc (STRing convert CHaRacter FROM C-sequence)
  12696.      
  12697.      KWIC:           convert a character from %C-sequence format to a single
  12698.                      character
  12699.      
  12700.      syntax:         #include "hhstring.h"
  12701.                      char strchrfromc(int *nchars, char *instring)
  12702.      
  12703.      description:    converts a C-sequence "character" to a string. If the
  12704.                      input character is not a C-sequence character, then it
  12705.                      is simply returned. The number of characters found in
  12706.                      the C-sequence is also "returned" by putting it in a
  12707.                      variable back in the calling program (see comments below).
  12708.                      The C-sequence strings handled are:
  12709.      
  12710.                              \0      string terminator
  12711.                              \a      bell
  12712.                              \b      backspace
  12713.                              \f      form feed
  12714.                              \n      feed
  12715.                              \r      carriage return
  12716.                              \t      tab
  12717.                              \v      vertical tab
  12718.      
  12719.                              \"      double quote
  12720.                              \'      single quote
  12721.                              \\      backslash
  12722.      
  12723.                              \xdd    dd = one or two hexadecimal digits
  12724.                              \nnn    nn = one to three OCTAL digits
  12725.      
  12726.      returns:        the converted character (there is not "failure" mode; all
  12727.                      input strings return a single character).
  12728.      
  12729.      comments:       when converting a single character, the number of
  12730.                      characters in the C-sequence may be irrelevant, but when
  12731.                      using this function to convert a whole string (as is done
  12732.                      when it is used by strfromc) it is necessary to know where
  12733.                      one has left off in the input string; this is the reason
  12734.                      for the nchars parameter.
  12735.  
  12736.  
  12737.  
  12738.  
  12739.  
  12740.  
  12741.  
  12742.  
  12743.  
  12744.      page 202            The Hobbit House String Library
  12745.  
  12746.  
  12747.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12748.      ║ CHRFROMC.C   ║   file date: 03/13/93    page   2 of   2 ║ CHRFROMC.C   ║
  12749.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12750.  
  12751.      
  12752.      
  12753.      keywords:       string, convert, character, C-sequence
  12754.      
  12755.      key sentence:   converts a character from C-sequence format to a single
  12756.                      character
  12757.      
  12758.      see also:       str{chr}<to | from>c
  12759.      
  12760.      usage example:  compiled/executed/verified on 12/15/92
  12761.      
  12762.                      char str1[10] = "\\\\";         note: backslash
  12763.                      char str2[10] = "\\t";          note: tab
  12764.                      int nchars;
  12765.                      printf("%d  %d", strchrfromc(&nchars, str1),
  12766.                                       strchrfromc(&nchars, str2));
  12767.      
  12768.                      92  9                   note: backslash  TAB
  12769.      
  12770.                               ┌───────────────────────┐
  12771.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  12772.                               └───────────────────────┘                      */
  12773.  
  12774.  
  12775.  
  12776.  
  12777.  
  12778.  
  12779.  
  12780.  
  12781.  
  12782.  
  12783.  
  12784.  
  12785.  
  12786.  
  12787.  
  12788.  
  12789.  
  12790.  
  12791.  
  12792.  
  12793.  
  12794.  
  12795.  
  12796.  
  12797.  
  12798.  
  12799.  
  12800.  
  12801.  
  12802.  
  12803.  
  12804.  
  12805.                          The Hobbit House String Library               page 203
  12806.  
  12807.  
  12808.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12809.      ║ CHRRPL.C     ║   file date: 03/13/93    page   1 of   1 ║ CHRRPL.C     ║
  12810.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12811.  
  12812.      /*                       ┌───────────────────────┐               strchrrpl
  12813.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  12814.                               └───────────────────────┘
  12815.                                copyright(c) 1992, 1993
  12816.      
  12817.      function:       strchrrpl (STRing CHaRacter RePLace)
  12818.      
  12819.      KWIC:           %replace all occurrences of one %character in a string
  12820.                      with another character
  12821.      
  12822.      syntax:         #include "hhstring.h"
  12823.                      char *strchrrpl(char *instring, char fromchar,
  12824.                                      char tochar)
  12825.      
  12826.      description:    all occurrences of fromchar in instring are replaced with
  12827.                      tochar
  12828.      
  12829.      returns:        a pointer to the string
  12830.      
  12831.      comments:       The string pointed to by the return value of this function
  12832.                      is in the calling function's space. The return value is
  12833.                      provided as a convenience, not a necessity.
  12834.      
  12835.      keywords:       string, character, replace
  12836.      
  12837.      key sentence:   replaces, in a string, all occurrences of one character
  12838.                      with another character
  12839.      
  12840.      see also:       strchrrpl{i}{new}
  12841.      
  12842.      usage example:  compiled/executed/verified on 12/15/92
  12843.      
  12844.                      char *Astring = "05/09/90";
  12845.                      strchrrpl(Astring, '/', '-');
  12846.                      printf("%s", Astring);
  12847.      
  12848.                      05-09-90
  12849.      
  12850.                               ┌───────────────────────┐
  12851.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  12852.                               └───────────────────────┘                      */
  12853.  
  12854.  
  12855.  
  12856.  
  12857.  
  12858.  
  12859.  
  12860.  
  12861.  
  12862.  
  12863.  
  12864.  
  12865.  
  12866.      page 204            The Hobbit House String Library
  12867.  
  12868.  
  12869.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12870.      ║ CHRRPLI.C    ║   file date: 03/13/93    page   1 of   1 ║ CHRRPLI.C    ║
  12871.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12872.  
  12873.      /*                       ┌───────────────────────┐              strchrrpli
  12874.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  12875.                               └───────────────────────┘
  12876.                                copyright(c) 1992, 1993
  12877.      
  12878.      function:       strchrrpli (STRing, CHaRacter, RePLace, case-Independant)
  12879.      
  12880.      KWIC:           %replace all matching %characterss, %indpendant of case
  12881.      
  12882.      syntax:         #include "hhstring.h"
  12883.                      char *strchrrpli(char *instring, int fromchar, int tochar)
  12884.      
  12885.      description:    all occurrences of the character fromchar in instring (no
  12886.                      matter which case it is in instring) are replaced by the
  12887.                      character tochar
  12888.      
  12889.      returns:        a pointer to the modified string
  12890.      
  12891.      comments:       none
  12892.      
  12893.      keywords:       string, character, replace, case-independent
  12894.      
  12895.      key sentence:   replaces, in a string, all case-independent occurrences
  12896.                      of one character with another character
  12897.      
  12898.      see also:       strchrrpl{i}{new}
  12899.      
  12900.      usage example:  compiled/executed/verified on 12/15/92
  12901.      
  12902.                      char *Astring = "This is the Sample String";
  12903.                      strchrrpli(Astring, 's', '*');
  12904.                      printf("\n%s", Astring);
  12905.                      printf("\n%s", strchrrpli(Astring, 't', '@'));
  12906.      
  12907.                      Thi* i* the *ample *tring
  12908.                      @hi* i* @he *ample *@ring
  12909.      
  12910.                               ┌───────────────────────┐
  12911.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  12912.                               └───────────────────────┘                      */
  12913.  
  12914.  
  12915.  
  12916.  
  12917.  
  12918.  
  12919.  
  12920.  
  12921.  
  12922.  
  12923.  
  12924.  
  12925.  
  12926.  
  12927.                          The Hobbit House String Library               page 205
  12928.  
  12929.  
  12930.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12931.      ║ CHRRPLIW.C   ║   file date: 03/13/93    page   1 of   2 ║ CHRRPLIW.C   ║
  12932.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12933.  
  12934.      /*                       ┌───────────────────────┐           strchrrplinew
  12935.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  12936.                               └───────────────────────┘
  12937.                                copyright(c) 1992, 1993
  12938.      
  12939.      function:       strchrrplinew (STRing, CHaRacter, RePLace,
  12940.                                     case-Independant, to NEW string)
  12941.      
  12942.      KWIC:           %replace all occurrences, %independant of case, of one
  12943.                      %character with another character
  12944.      
  12945.      syntax:         #include "hhstring.h"
  12946.                      char *strchrrplinew(char *newstring, char *instring,
  12947.                                              char fromchar, char tochar)
  12948.      
  12949.      description:    all case-independent occurrences of fromchar are replaced
  12950.                      with tochar as the string is otherwise copied from
  12951.                      instring to newstring.
  12952.      
  12953.      returns:        a pointer to the new string
  12954.      
  12955.      comments:       The string pointed to by the return value of this function
  12956.                      is in the calling function's space. The return value is
  12957.                      provided as a convenience, not a necessity.
  12958.      
  12959.                      Setting newstring = instring will work OK with this
  12960.                      function but overlapping newstring/instring may or may
  12961.                      not work so if you must overlap, do it cautiously.
  12962.      
  12963.      keywords:       string, character, replace, case-independent, new
  12964.      
  12965.      key sentence:   replaces, in a string, all case-independent occurrences
  12966.                      of one character with another character and puts the
  12967.                      result into a new string
  12968.      
  12969.      see also:       strchrrpl{i}{new}
  12970.      
  12971.  
  12972.  
  12973.  
  12974.  
  12975.  
  12976.  
  12977.  
  12978.  
  12979.  
  12980.  
  12981.  
  12982.  
  12983.  
  12984.  
  12985.  
  12986.  
  12987.  
  12988.      page 206            The Hobbit House String Library
  12989.  
  12990.  
  12991.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  12992.      ║ CHRRPLIW.C   ║   file date: 03/13/93    page   2 of   2 ║ CHRRPLIW.C   ║
  12993.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  12994.  
  12995.      
  12996.      
  12997.      usage example:  compiled/executed/verified on 12/15/92
  12998.      
  12999.                      char *Astring = "This is the Sample String";
  13000.                      char Bstring[80];
  13001.                      strchrrplinew(Bstring, Astring, 's', '*');
  13002.                      printf("\n%s", Bstring);
  13003.                      printf("\n%s", strchrrplinew(Bstring, Astring, 't', '@'));
  13004.      
  13005.                      Thi* i* the *ample *tring
  13006.                      @his is @he Sample S@ring
  13007.      
  13008.                               ┌───────────────────────┐
  13009.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  13010.                               └───────────────────────┘                      */
  13011.  
  13012.  
  13013.  
  13014.  
  13015.  
  13016.  
  13017.  
  13018.  
  13019.  
  13020.  
  13021.  
  13022.  
  13023.  
  13024.  
  13025.  
  13026.  
  13027.  
  13028.  
  13029.  
  13030.  
  13031.  
  13032.  
  13033.  
  13034.  
  13035.  
  13036.  
  13037.  
  13038.  
  13039.  
  13040.  
  13041.  
  13042.  
  13043.  
  13044.  
  13045.  
  13046.  
  13047.  
  13048.  
  13049.                          The Hobbit House String Library               page 207
  13050.  
  13051.  
  13052.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13053.      ║ CHRRPLW.C    ║   file date: 03/13/93    page   1 of   2 ║ CHRRPLW.C    ║
  13054.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13055.  
  13056.      /*                       ┌───────────────────────┐            strchrrplnew
  13057.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  13058.                               └───────────────────────┘
  13059.                                copyright(c) 1992, 1993
  13060.      
  13061.      function:       strchrrplnew (STRing CHaRacter RePLace to NEW string)
  13062.      
  13063.      KWIC:           %replace all occurrences of one %character with another
  13064.                      character
  13065.      
  13066.      syntax:         #include "hhstring.h"
  13067.                      char *strchrrplnew(char *newstring, char *instring,
  13068.                                         char fromchar, char tochar)
  13069.      
  13070.      description:    all occurrences of fromchar are replaced with tochar as
  13071.                                                                             the
  13072.                      string is otherwise copied from instring to newstring.
  13073.      
  13074.      returns:        a pointer to the new string
  13075.      
  13076.      comments:       The string pointed to by the return value of this function
  13077.                      is in the calling function's space. The return value is
  13078.                      provided as a convenience, not a necessity.
  13079.      
  13080.                      Setting newstring = instring will work OK with this
  13081.                      function but overlapping newstring/instring may or may
  13082.                      not work so if you must overlap, do it cautiously.
  13083.      
  13084.      keywords:       string, character, replace, new
  13085.      
  13086.      key sentence:   replaces, in a string, all occurrences of one character
  13087.                      with another character and puts the result into a new
  13088.                      string
  13089.      
  13090.      see also:       strchrrpl{i}{new}
  13091.      
  13092.  
  13093.  
  13094.  
  13095.  
  13096.  
  13097.  
  13098.  
  13099.  
  13100.  
  13101.  
  13102.  
  13103.  
  13104.  
  13105.  
  13106.  
  13107.  
  13108.  
  13109.  
  13110.      page 208            The Hobbit House String Library
  13111.  
  13112.  
  13113.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13114.      ║ CHRRPLW.C    ║   file date: 03/13/93    page   2 of   2 ║ CHRRPLW.C    ║
  13115.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13116.  
  13117.      
  13118.      
  13119.      usage example:  compiled/executed/verified on 12/15/92
  13120.      
  13121.                      char Astring[80] = "05/09/90";
  13122.                      char Bstring[80] = "05.09.90";
  13123.                      char Cstring[80];
  13124.                      strchrrplnew(Cstring, Astring, '/', '-');
  13125.                      printf("\n%s", Cstring);
  13126.                      printf("\n%s", strchrrplnew(Cstring, Bstring, '.', '-'));
  13127.      
  13128.                      05-09-90
  13129.                      05-09-90
  13130.      
  13131.                               ┌───────────────────────┐
  13132.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  13133.                               └───────────────────────┘                      */
  13134.  
  13135.  
  13136.  
  13137.  
  13138.  
  13139.  
  13140.  
  13141.  
  13142.  
  13143.  
  13144.  
  13145.  
  13146.  
  13147.  
  13148.  
  13149.  
  13150.  
  13151.  
  13152.  
  13153.  
  13154.  
  13155.  
  13156.  
  13157.  
  13158.  
  13159.  
  13160.  
  13161.  
  13162.  
  13163.  
  13164.  
  13165.  
  13166.  
  13167.  
  13168.  
  13169.  
  13170.  
  13171.                          The Hobbit House String Library               page 209
  13172.  
  13173.  
  13174.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13175.      ║ CHRTOC.C     ║   file date: 03/13/93    page   1 of   2 ║ CHRTOC.C     ║
  13176.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13177.  
  13178.      /*                       ┌───────────────────────┐               strchrtoc
  13179.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  13180.                               └───────────────────────┘
  13181.                                copyright(c) 1992, 1993
  13182.      
  13183.      function:       strchrtoc (STRing CHaRacter TO C format)
  13184.      
  13185.      KWIC:           %convert a character to %C-sequence format
  13186.      
  13187.      syntax:         #include "hhstring.h"
  13188.                      int strchrtoc(char* tostring, char inchar)
  13189.      
  13190.      description:    converts a single character into the proper C-language
  13191.                      representation. Characters requiring numerical
  13192.                      representation will be put in the hex-string format.
  13193.                      The C-sequences for all of the characters handled by
  13194.                      this function are:
  13195.      
  13196.                              \0      string terminator
  13197.                              \a      bell
  13198.                              \b      backspace
  13199.                              \f      form feed
  13200.                              \n      feed
  13201.                              \r      carriage return
  13202.                              \t      tab
  13203.                              \v      vertical tab
  13204.                              \"      double quote
  13205.                              \'      single quote
  13206.                              \\      backslash
  13207.      
  13208.                              \xdd    dd = two hexadecimal digits (this
  13209.                                           format is used for all chars
  13210.                                           which require numerical
  13211.                                           representation)
  13212.      
  13213.      returns:        the number of characters in the output sequence
  13214.      
  13215.      comments:       note that the output sequence is terminated with a
  13216.                      binary 0, just like any C string
  13217.      
  13218.      keywords:       string, character, convert, C-sequence
  13219.      
  13220.      key sentence:   converts a single character to the C-sequence
  13221.                      representation
  13222.      
  13223.      see also:       str{chr}<to | from>c
  13224.      
  13225.  
  13226.  
  13227.  
  13228.  
  13229.  
  13230.  
  13231.  
  13232.      page 210            The Hobbit House String Library
  13233.  
  13234.  
  13235.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13236.      ║ CHRTOC.C     ║   file date: 03/13/93    page   2 of   2 ║ CHRTOC.C     ║
  13237.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13238.  
  13239.      
  13240.      
  13241.      usage example:  compiled/executed/verified on 12/15/92
  13242.      
  13243.                      char dst[5];
  13244.                      strchrtoc(dst, '\5');    printf("%s ", dst);
  13245.                      strchrtoc(dst, '\t');   printf("%s ", dst);
  13246.                      strchrtoc(dst, '\142'); printf("%s ", dst);
  13247.      
  13248.                      \x05 \t b
  13249.      
  13250.                               ┌───────────────────────┐
  13251.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  13252.                               └───────────────────────┘                      */
  13253.  
  13254.  
  13255.  
  13256.  
  13257.  
  13258.  
  13259.  
  13260.  
  13261.  
  13262.  
  13263.  
  13264.  
  13265.  
  13266.  
  13267.  
  13268.  
  13269.  
  13270.  
  13271.  
  13272.  
  13273.  
  13274.  
  13275.  
  13276.  
  13277.  
  13278.  
  13279.  
  13280.  
  13281.  
  13282.  
  13283.  
  13284.  
  13285.  
  13286.  
  13287.  
  13288.  
  13289.  
  13290.  
  13291.  
  13292.  
  13293.                          The Hobbit House String Library               page 211
  13294.  
  13295.  
  13296.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13297.      ║ CODE1.C      ║   file date: 03/13/93    page   1 of   2 ║ CODE1.C      ║
  13298.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13299.  
  13300.      /*                       ┌───────────────────────┐                strcode1
  13301.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  13302.                               └───────────────────────┘
  13303.                                copyright(c) 1992, 1993
  13304.      
  13305.      function:       strcode1 (STRing en/deCODE, version 1)
  13306.      
  13307.      KWIC:           %encode or %decode a string
  13308.      
  13309.      common uses:    part of copy protection schemes
  13310.      
  13311.      syntax:         #include "hhstring.h"
  13312.                      char *strcode1 (char *instring, char *codestring)
  13313.      
  13314.      description:    This function is a very simple but highly effective
  13315.                      encode/decode scheme, with the nifty property of being
  13316.                      both the encoder and the decoder. When called to act
  13317.                      on an original string, it encodes it using the code
  13318.                      string provided. If called on to act on the encoded
  13319.                      string using the same code string, it then decodes the
  13320.                      string back to the original.
  13321.      
  13322.      returns:        a pointer to the string
  13323.      
  13324.      comments:       When used in conjunction with the function strtoc, this
  13325.                      function can be used to generate strings which can be
  13326.                      used for copy protection schemes or for any other reason
  13327.                      one might have to hide messages in .EXE or .COM files.
  13328.      
  13329.      keywords:       string, encode, decode, convert
  13330.      
  13331.      key sentence:   encodes/decodes a string using a "one-time-pad"
  13332.      
  13333.      see also:       strcode1        strcode2
  13334.      
  13335.      usage example:  compiled/executed/verified on 12/13/92
  13336.      
  13337.                      void dotprint(char *s);
  13338.      
  13339.                      void main(void)
  13340.                      { char *code = "EXAMPLE CODING STRING";
  13341.                        char *s ="sample string to en/decode";
  13342.      
  13343.                        printf("\n\n");
  13344.                        printf("\noriginal: ");
  13345.                        dotprint(s);
  13346.                        strcode1(s, code);
  13347.                        printf("\nencoded:  ");
  13348.                        dotprint(s);
  13349.                        strcode1(s, code);
  13350.                        printf("\nrecoded:  ");
  13351.                        dotprint(s);
  13352.                      }
  13353.  
  13354.      page 212            The Hobbit House String Library
  13355.  
  13356.  
  13357.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13358.      ║ CODE1.C      ║   file date: 03/13/93    page   2 of   2 ║ CODE1.C      ║
  13359.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13360.  
  13361.      
  13362.                      void dotprint(char *s)
  13363.                      { int ii;
  13364.                        for (ii = 0; ii < strlen(s); ii++)
  13365.                          if (s[ii] < ' ')
  13366.                            printf(".");
  13367.                          else
  13368.                            printf("%c", s[ii]);
  13369.                        printf("\n");
  13370.                      }
  13371.      
  13372.                      original: sample string to en/decode
  13373.      
  13374.                      encoded:  69,=<)eS7=-')gT<t7'a# ;.)5
  13375.      
  13376.                      recoded:  sample string to en/decode
  13377.      
  13378.                               ┌───────────────────────┐
  13379.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  13380.                               └───────────────────────┘                      */
  13381.  
  13382.  
  13383.  
  13384.  
  13385.  
  13386.  
  13387.  
  13388.  
  13389.  
  13390.  
  13391.  
  13392.  
  13393.  
  13394.  
  13395.  
  13396.  
  13397.  
  13398.  
  13399.  
  13400.  
  13401.  
  13402.  
  13403.  
  13404.  
  13405.  
  13406.  
  13407.  
  13408.  
  13409.  
  13410.  
  13411.  
  13412.  
  13413.  
  13414.  
  13415.                          The Hobbit House String Library               page 213
  13416.  
  13417.  
  13418.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13419.      ║ CODE2.C      ║   file date: 03/13/93    page   1 of   2 ║ CODE2.C      ║
  13420.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13421.  
  13422.      /*                       ┌───────────────────────┐                strcode2
  13423.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  13424.                               └───────────────────────┘
  13425.                                copyright(c) 1992, 1993
  13426.      
  13427.      function:       strcode2 (STRing en/deCODE, version 2)
  13428.      
  13429.      KWIC:           %encode or %decode a string
  13430.      
  13431.      common uses:    part of copy protection schemes
  13432.      
  13433.      syntax:         #include "hhstring.h"
  13434.                      char *strcode2(char *instring)
  13435.      
  13436.      description:    This function is a very simple but highly effective
  13437.                      encode/decode scheme, with the nifty property of being
  13438.                      both the encoder and the decoder. Unlike its sister
  13439.                      function strcode1, this version does not require a code
  13440.                      string. When called to act on an original string, it
  13441.                      encodes it using a fixed code sequence which it
  13442.                      generates. When run on an encoded string, it decodes
  13443.                      the string back to its original form
  13444.      
  13445.      returns:        a pointer to the string
  13446.      
  13447.      comments:       When used in conjunction with the function strtoc, this
  13448.                      function can be used to generate strings which can be
  13449.                      used for copy protection schemes or for any other reason
  13450.                      one might have to hide messages.
  13451.      
  13452.      keywords:       string, encode, decode, convert
  13453.      
  13454.      key sentence:   encodes/decodes a string using a fixed algorithm
  13455.      
  13456.      see also:       strcode1        strcode2
  13457.      
  13458.      usage example:  compiled/executed/verified on 12/13/92
  13459.      
  13460.                      void dotprint(char *s);
  13461.                      void main(void)
  13462.                      { char *s ="sample string to en/decode";
  13463.                        printf("\n\n");
  13464.                        printf("\noriginal: ");
  13465.                        dotprint(s);
  13466.                        strcode2(s);
  13467.                        printf("\nencoded:  ");
  13468.                        dotprint(s);
  13469.                        strcode2(s);
  13470.                        printf("\nrecoded:  ");
  13471.                        dotprint(s);
  13472.                      }
  13473.      
  13474.                      void dotprint(char *s)
  13475.  
  13476.      page 214            The Hobbit House String Library
  13477.  
  13478.  
  13479.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13480.      ║ CODE2.C      ║   file date: 03/13/93    page   2 of   2 ║ CODE2.C      ║
  13481.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13482.  
  13483.                      { int ii;
  13484.                        for (ii = 0; ii < strlen(s); ii++)
  13485.                          if (s[ii] < ' ')
  13486.                            printf(".");
  13487.                          else
  13488.                            printf("%c", s[ii]);
  13489.                        printf("\n");
  13490.                      }
  13491.      
  13492.                      original: sample string to en/decode
  13493.      
  13494.                      encoded:  .7.P..o.m..&.2..a.e_._.k..
  13495.      
  13496.                      recoded:  sample string to en/decode
  13497.      
  13498.                               ┌───────────────────────┐
  13499.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  13500.                               └───────────────────────┘                      */
  13501.  
  13502.  
  13503.  
  13504.  
  13505.  
  13506.  
  13507.  
  13508.  
  13509.  
  13510.  
  13511.  
  13512.  
  13513.  
  13514.  
  13515.  
  13516.  
  13517.  
  13518.  
  13519.  
  13520.  
  13521.  
  13522.  
  13523.  
  13524.  
  13525.  
  13526.  
  13527.  
  13528.  
  13529.  
  13530.  
  13531.  
  13532.  
  13533.  
  13534.  
  13535.  
  13536.  
  13537.                          The Hobbit House String Library               page 215
  13538.  
  13539.  
  13540.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13541.      ║ COMA.C       ║   file date: 03/13/93    page   1 of   1 ║ COMA.C       ║
  13542.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13543.  
  13544.      /*                       ┌───────────────────────┐                strcomma
  13545.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  13546.                               └───────────────────────┘
  13547.                                copyright(c) 1992, 1993
  13548.      
  13549.      function:       strcomma (STRing, add COMMAs)
  13550.      
  13551.      KWIC:           insert %commas in a string
  13552.      
  13553.      syntax:         #include "hhstring.h"
  13554.                      char *strcomma(char *instring)
  13555.      
  13556.      description:    strips whitespace off of both sides of instring and then
  13557.                      adds commas every third place from the right so the result
  13558.                      is proper for decimal numbers
  13559.      
  13560.      returns:        a pointer to instring
  13561.      
  13562.      comments:       (1) the string space in memory must be sufficient to hold
  13563.                          the added commas, else there be dragons
  13564.                      (2) the function works the same regardless of the
  13565.                          character contents of the input string; that is, it
  13566.                          will put commas every three spaces from the right in
  13567.                          ANY string, not just ones which represents a decimal
  13568.                          number.
  13569.                      (3) strcommanew is MUCH more efficient
  13570.                      (4) The string pointed to by the return value of this
  13571.                          function is in the calling function's space. The
  13572.                          return value is provided as a convenience, not a
  13573.                          necessity.
  13574.      
  13575.      keywords:       string, commas, ASCII, decimal, numeric
  13576.      
  13577.      key sentence:   adds commas to an ASCII-decimal string
  13578.      
  13579.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  13580.      
  13581.      usage example:  compiled/executed/verified on 12/16/92
  13582.      
  13583.                      char Astring[80] = "   1234567890      ";
  13584.                      strcomma(Astring);
  13585.                      printf("\n%s\n", Astring);
  13586.      
  13587.                      1,234,567,890
  13588.      
  13589.                               ┌───────────────────────┐
  13590.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  13591.                               └───────────────────────┘                      */
  13592.  
  13593.  
  13594.  
  13595.  
  13596.  
  13597.  
  13598.      page 216            The Hobbit House String Library
  13599.  
  13600.  
  13601.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13602.      ║ COMAF.C      ║   file date: 03/13/93    page   1 of   1 ║ COMAF.C      ║
  13603.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13604.  
  13605.      /*                       ┌───────────────────────┐               strcommaf
  13606.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  13607.                               └───────────────────────┘
  13608.                                copyright(c) 1992, 1993
  13609.      
  13610.      function:       strcommaf (STRing, add COMMAs, for Floating point #s)
  13611.      
  13612.      KWIC:           insert %commas into a %floating point number string
  13613.      
  13614.      syntax:         #include <stddef.h>
  13615.                      #include "hhstring.h"
  13616.                      char *strcommaf(char *instring)
  13617.      
  13618.      description:    strips whitespace off of both sides of instring and then
  13619.                      adds commas every third place to the left of the decimal
  13620.                      point
  13621.      
  13622.      returns:        a pointer to instring
  13623.      
  13624.      comments:       (1) the string space in memory must be sufficient to hold
  13625.                          the added commas.
  13626.                      (2) If there is no decimal point, it is implied as the
  13627.                          last character once whitespace has been stripped off.
  13628.                      (3) This function will cause memory problems if there are
  13629.                          more than 9 digits after the decimal point or more
  13630.                          than 15 digits to the left of the decimal point.
  13631.                      (4) The string pointed to by the return value of this
  13632.                          function is in the calling function's space. The
  13633.                          return value is provided as a convenience, not a
  13634.                          necessity.
  13635.      
  13636.      keywords:       string, commas, float, ASCII
  13637.      
  13638.      key sentence:   adds commas to an ASCII-floating point string
  13639.      
  13640.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  13641.      
  13642.      usage example:  compiled/executed/verified on 1/1/93
  13643.      
  13644.                      char Astring[80] = "   12345678.90      ";
  13645.                      strcommaf(Astring);
  13646.                      printf("\n%s\n", Astring);
  13647.      
  13648.                      12,345,678.90
  13649.      
  13650.                               ┌───────────────────────┐
  13651.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  13652.                               └───────────────────────┘                      */
  13653.  
  13654.  
  13655.  
  13656.  
  13657.  
  13658.  
  13659.                          The Hobbit House String Library               page 217
  13660.  
  13661.  
  13662.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13663.      ║ COMAFW.C     ║   file date: 03/13/93    page   1 of   2 ║ COMAFW.C     ║
  13664.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13665.  
  13666.      /*                       ┌───────────────────────┐           strcommafnew
  13667.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  13668.                               └───────────────────────┘
  13669.                                copyright(c) 1992, 1993
  13670.      
  13671.      function:       strcommafnew (STRing, add COMMAs, for Floating point #s,
  13672.                                    to NEW string)
  13673.      
  13674.      KWIC:           insert %commas into a %floating point number string
  13675.      
  13676.      syntax:         #include <stddef.h>
  13677.                      #include "hhstring.h"
  13678.                      char *strcommafnew(char *newstring, char *instring)
  13679.      
  13680.      description:    strips whitespace off of both sides of instring and then
  13681.                      adds commas every third place to the left of the decimal
  13682.                      point, putting the result in newstring; instring is
  13683.                      unchanged.
  13684.      
  13685.      returns:        a pointer to newstring
  13686.      
  13687.      comments:       (1) If there is no decimal point, it is implied as the
  13688.                          last character once whitespace has been stripped off.
  13689.                      (2) This function will cause memory problems if there are
  13690.                          more than 9 digits after the decimal point or more
  13691.                          than 15 digits to the left of the decimal point.
  13692.                      (3) The string pointed to by the return value of this
  13693.                          function is in the calling function's space. The
  13694.                          return value is provided as a convenience, not a
  13695.                          necessity.
  13696.      
  13697.      keywords:       string, commas, float, new, ASCII
  13698.      
  13699.      key sentence:   adds commas to an ASCII floating point string and puts
  13700.                      the result in a new string
  13701.      
  13702.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  13703.      
  13704.  
  13705.  
  13706.  
  13707.  
  13708.  
  13709.  
  13710.  
  13711.  
  13712.  
  13713.  
  13714.  
  13715.  
  13716.  
  13717.  
  13718.  
  13719.  
  13720.      page 218            The Hobbit House String Library
  13721.  
  13722.  
  13723.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13724.      ║ COMAFW.C     ║   file date: 03/13/93    page   2 of   2 ║ COMAFW.C     ║
  13725.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13726.  
  13727.      
  13728.      
  13729.      usage example:  compiled/executed/verified on 1/1/93
  13730.      
  13731.                      char Astring[80] = "   12345678.90     ";
  13732.                      char Bstring[80];
  13733.                      strcommafnew(Bstring, Astring);
  13734.                      printf("%s", Bstring);
  13735.      
  13736.                      12,345,678.90
  13737.      
  13738.                               ┌───────────────────────┐
  13739.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  13740.                               └───────────────────────┘                      */
  13741.  
  13742.  
  13743.  
  13744.  
  13745.  
  13746.  
  13747.  
  13748.  
  13749.  
  13750.  
  13751.  
  13752.  
  13753.  
  13754.  
  13755.  
  13756.  
  13757.  
  13758.  
  13759.  
  13760.  
  13761.  
  13762.  
  13763.  
  13764.  
  13765.  
  13766.  
  13767.  
  13768.  
  13769.  
  13770.  
  13771.  
  13772.  
  13773.  
  13774.  
  13775.  
  13776.  
  13777.  
  13778.  
  13779.  
  13780.  
  13781.                          The Hobbit House String Library               page 219
  13782.  
  13783.  
  13784.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13785.      ║ COMAFRI.C    ║   file date: 03/13/93    page   1 of   1 ║ COMAFRI.C    ║
  13786.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13787.  
  13788.      /*                       ┌───────────────────────┐             strcommafri
  13789.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  13790.                               └───────────────────────┘
  13791.                                copyright(c) 1992, 1993
  13792.      
  13793.      function:       strcommafri (make STRing, with COMMAs, FRom Integer)
  13794.      
  13795.      KWIC:           convert an %integer to a string with %commas
  13796.      
  13797.      syntax:         #include <stdio.h>
  13798.                      #include "hhstring.h"
  13799.                      char *strcommafri(char *result, int num)
  13800.      
  13801.      description:    converts the integer "num" into the string "result" and
  13802.                      adds commas ever third place from the right, while dealing
  13803.                      properly with the minus sign (if there is one)
  13804.      
  13805.      returns:        a pointer to the string (result)
  13806.      
  13807.      comments:       The string pointed to by the return value of this
  13808.                      function is in the calling function's space. The return
  13809.                      value is provided as a convenience, not a necessity.
  13810.      
  13811.      keywords:       string, convert, commas, numeric, integer, decimal, ASCII
  13812.      
  13813.      key sentence:   converts a signed integer into an ASCII-decimal string
  13814.                                                                            with
  13815.                      commas
  13816.      
  13817.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  13818.      
  13819.      usage example:  compiled/executed/verified on 1/1/93
  13820.      
  13821.                      char str1[20];
  13822.                      strcommafri(str1, 12345);
  13823.                      printf("\n%s", str1);
  13824.                      printf("\n%s", strcommafri(str1, -12345));
  13825.      
  13826.                      12,345
  13827.                      -12,345
  13828.      
  13829.                               ┌───────────────────────┐
  13830.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  13831.                               └───────────────────────┘                      */
  13832.  
  13833.  
  13834.  
  13835.  
  13836.  
  13837.  
  13838.  
  13839.  
  13840.  
  13841.  
  13842.      page 220            The Hobbit House String Library
  13843.  
  13844.  
  13845.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13846.      ║ COMAFRL.C    ║   file date: 03/13/93    page   1 of   1 ║ COMAFRL.C    ║
  13847.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13848.  
  13849.      /*                       ┌───────────────────────┐            strcommafrl
  13850.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  13851.                               └───────────────────────┘
  13852.                                copyright(c) 1992, 1993
  13853.      
  13854.      function:       strcommafrl (make STRing, with COMMAs, FRom Long)
  13855.      
  13856.      KWIC:           convert a %long number to a string with %commas
  13857.      
  13858.      syntax:         #include <stdio.h>
  13859.                      #include "hhstring.h"
  13860.                      char *strcommafrl(char *result, long num)
  13861.      
  13862.      description:    converts the long number "num" into the string "result"
  13863.                      and adds commas ever third place from the right,
  13864.                      dealing properly with the minus sign (if there is one)
  13865.      
  13866.      returns:        a pointer to the string (result)
  13867.      
  13868.      comments:       The string pointed to by the return value of this
  13869.                      function is in the calling function's space. The return
  13870.                      value is provided as a convenience, not a necessity.
  13871.      
  13872.      keywords:       string, convert, commas, numeric, long, ASCII, decimal
  13873.      
  13874.      key sentence:   converts a signed long number into an ASCII-decimal string
  13875.                      with commas
  13876.      
  13877.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  13878.      
  13879.      usage example:  compiled/executed/verified on 1/1/93
  13880.      
  13881.                      char str1[20];
  13882.                      strcommafrl(str1, 1234567890L);
  13883.                      printf("\n%s", str1);
  13884.                      printf("\n%s", strcommafrl(str1, -12345678L));
  13885.      
  13886.                      1,234,567,890
  13887.                      -12,345,678
  13888.      
  13889.                               ┌───────────────────────┐
  13890.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  13891.                               └───────────────────────┘                      */
  13892.  
  13893.  
  13894.  
  13895.  
  13896.  
  13897.  
  13898.  
  13899.  
  13900.  
  13901.  
  13902.  
  13903.                          The Hobbit House String Library               page 221
  13904.  
  13905.  
  13906.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13907.      ║ COMAFRUI.C   ║   file date: 03/13/93    page   1 of   1 ║ COMAFRUI.C   ║
  13908.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13909.  
  13910.      /*                       ┌───────────────────────┐            strcommafrui
  13911.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  13912.                               └───────────────────────┘
  13913.                                copyright(c) 1992, 1993
  13914.      
  13915.      function:       strcommafrui (make STRing, with COMMAs, FRom Unsigned
  13916.                                    Integer)
  13917.      
  13918.      KWIC:           convert an unsigned %integer to a string with %commas
  13919.      
  13920.      syntax:         #include <stdio.h>
  13921.                      #include "hhstring.h"
  13922.                      char *strcommafrui(char *result, unsigned int num)
  13923.      
  13924.      description:    converts the unsigned integer "num" into the string
  13925.                      "result" and adds commas ever third place from the right
  13926.      
  13927.      returns:        a pointer to the string (result)
  13928.      
  13929.      comments:       The string pointed to by the return value of this
  13930.                      function is in the calling function's space. The return
  13931.                      value is provided as a convenience, not a necessity.
  13932.      
  13933.      keywords:       string, convert, numeric, commas, ASCII, integer
  13934.      
  13935.      key sentence:   converts an unsigned integer into an ASCII-decimal string
  13936.                      with commas
  13937.      
  13938.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  13939.      
  13940.      usage example:  compiled/executed/verified on 1/1/93
  13941.      
  13942.                      char str1[20];
  13943.                      strcommafrui(str1, 12345);
  13944.                      printf("\n%s", str1);
  13945.                      printf("\n%s", strcommafrui(str1, (unsigned int)60000L));
  13946.      
  13947.                      note: the construct "(unsigned int)60000L" is not
  13948.                            strictly necessary, but avoids a compiler warning
  13949.                            in the Borland compiler. A simple 60000 will work,
  13950.                            but will give a warning.
  13951.      
  13952.                      12,345
  13953.                      60,000
  13954.      
  13955.                               ┌───────────────────────┐
  13956.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  13957.                               └───────────────────────┘                      */
  13958.  
  13959.  
  13960.  
  13961.  
  13962.  
  13963.  
  13964.      page 222            The Hobbit House String Library
  13965.  
  13966.  
  13967.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  13968.      ║ COMAFRUL.C   ║   file date: 03/13/93    page   1 of   1 ║ COMAFRUL.C   ║
  13969.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  13970.  
  13971.      /*                       ┌───────────────────────┐            strcommafrul
  13972.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  13973.                               └───────────────────────┘
  13974.                                copyright(c) 1992, 1993
  13975.      
  13976.      function:       strcommafrul (make STRing, with COMMAs, FRom Unsigned
  13977.                                    Long)
  13978.      
  13979.      KWIC:           convert an unsigned %long number to a string with %commas
  13980.      
  13981.      syntax:         #include <stdio.h>
  13982.                      #include "hhstring.h"
  13983.                      char *strcommafrul(char *result, unsigned long num)
  13984.      
  13985.      description:    converts the unsigned long number "num" into the string
  13986.                      "result" and adds commas ever third place from the right
  13987.      
  13988.      returns:        a pointer to the string (result)
  13989.      
  13990.      comments:       The string pointed to by the return value of this
  13991.                      function is in the calling function's space. The return
  13992.                      value is provided as a convenience, not a necessity.
  13993.      
  13994.      keywords:       string, convert, commas, numeric, long, ASCII, decimal
  13995.      
  13996.      key sentence:   converts an unsigned long number into an ASCII-decimal
  13997.                      string with commas
  13998.      
  13999.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  14000.      
  14001.      usage example:  compiled/executed/verified on 12/17/92
  14002.      
  14003.                      char str1[20];
  14004.                      strcommafrul(str1, 4000000000L);
  14005.                      printf("\n%s", str1);
  14006.                      printf("\n%s", strcommafrul(str1, 4000000000L));
  14007.      
  14008.                      4,000,000,000
  14009.                      4,000,000,000
  14010.      
  14011.                               ┌───────────────────────┐
  14012.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14013.                               └───────────────────────┘                      */
  14014.  
  14015.  
  14016.  
  14017.  
  14018.  
  14019.  
  14020.  
  14021.  
  14022.  
  14023.  
  14024.  
  14025.                          The Hobbit House String Library               page 223
  14026.  
  14027.  
  14028.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14029.      ║ COMAN.C      ║   file date: 03/13/93    page   1 of   2 ║ COMAN.C      ║
  14030.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14031.  
  14032.      /*                       ┌───────────────────────┐               strcomman
  14033.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  14034.                               └───────────────────────┘
  14035.                                copyright(c) 1992, 1993
  14036.      
  14037.      function:       strcomman (STRing, add COMMAs, to N-char size)
  14038.      
  14039.      KWIC:           insert %commas into a string and pad the string on the
  14040.                                                                            left
  14041.                      to force it to a given %size
  14042.      
  14043.      syntax:         #include "hhstring.h"
  14044.                      char *strcomman(char *instring, int nchar)
  14045.      
  14046.      description:    strips whitespace off of both sides of instring and then
  14047.                      adds commas every third place from the right so the result
  14048.                      is proper for decimal numbers. Pads with blanks on the
  14049.                      left so as to make instring nchar total characters long.
  14050.      
  14051.      returns:        a pointer to the string
  14052.      
  14053.      comments:       (1) the string space in memory must be sufficient to hold
  14054.                          the added commas.
  14055.                      (2) the function works the same regardless of the
  14056.                          character contents of the input string; that is, it
  14057.                          will put commas every three spaces from the right in
  14058.                          ANY string, not just one which represents a decimal
  14059.                          number.
  14060.                      (3) The string pointed to by the return value of this
  14061.                          function is in the calling function's space. The
  14062.                          return value is provided as a convenience, not a
  14063.                          necessity.
  14064.      
  14065.      keywords:       string, commas, size
  14066.      
  14067.      key sentence:   inserts commas into a string and pads the string on the
  14068.                      left to force it to a given size
  14069.      
  14070.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  14071.      
  14072.  
  14073.  
  14074.  
  14075.  
  14076.  
  14077.  
  14078.  
  14079.  
  14080.  
  14081.  
  14082.  
  14083.  
  14084.  
  14085.  
  14086.      page 224            The Hobbit House String Library
  14087.  
  14088.  
  14089.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14090.      ║ COMAN.C      ║   file date: 03/13/93    page   2 of   2 ║ COMAN.C      ║
  14091.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14092.  
  14093.      
  14094.      
  14095.      usage example:  compiled/executed/verified on 1/1/93
  14096.      
  14097.                      char Astring[80];
  14098.                      strcpy(Astring, " 1234567890      ");
  14099.                      strcomman(Astring, 15);
  14100.                      printf("-->%s<--", Astring);
  14101.      
  14102.                      -->  1,234,567,890<--
  14103.      
  14104.                               ┌───────────────────────┐
  14105.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14106.                               └───────────────────────┘                      */
  14107.  
  14108.  
  14109.  
  14110.  
  14111.  
  14112.  
  14113.  
  14114.  
  14115.  
  14116.  
  14117.  
  14118.  
  14119.  
  14120.  
  14121.  
  14122.  
  14123.  
  14124.  
  14125.  
  14126.  
  14127.  
  14128.  
  14129.  
  14130.  
  14131.  
  14132.  
  14133.  
  14134.  
  14135.  
  14136.  
  14137.  
  14138.  
  14139.  
  14140.  
  14141.  
  14142.  
  14143.  
  14144.  
  14145.  
  14146.  
  14147.                          The Hobbit House String Library               page 225
  14148.  
  14149.  
  14150.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14151.      ║ COMAW.C      ║   file date: 03/13/93    page   1 of   2 ║ COMAW.C      ║
  14152.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14153.  
  14154.      /*                       ┌───────────────────────┐             strcommanew
  14155.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  14156.                               └───────────────────────┘
  14157.                                copyright(c) 1992, 1993
  14158.      
  14159.      function:       strcommanew (STRing, add COMMAs, to NEW string)
  14160.      
  14161.      KWIC:           insert %commas into a string
  14162.      
  14163.      syntax:         #include "hhstring.h"
  14164.                      char *strcommanew(char *newstring, char *instring)
  14165.      
  14166.      description:    strips whitespace off of both sides of instring and then
  14167.                      adds commas every third place from the right so the result
  14168.                      is proper for decimal numbers. Puts the result into
  14169.                      newstring; instring is unchanged.
  14170.      
  14171.      returns:        a pointer to the new string
  14172.      
  14173.      comments:       (1) the function works the same regardless of the
  14174.                          character contents of the input string; that is, it
  14175.                          will put commas every three spaces from the right in
  14176.                          ANY string, not just one which represents a decimal
  14177.                          number.
  14178.                      (2) strcommanew is MUCH more efficient than strcomma
  14179.                      (3) Setting newstring = instring WILL NOT WORK with this
  14180.                          function and overlapping newstring/instring may or may
  14181.                          not work so if you must overlap, do it cautiously.
  14182.                      (4) The string pointed to by the return value of this
  14183.                          function is in the calling function's space. The
  14184.                          return value is provided as a convenience, not a
  14185.                          necessity.
  14186.      
  14187.      keywords:       string, commas, new, ASCII, decimal, numeric
  14188.      
  14189.      key sentence:   inserts commas into an ASCII-decimal string, with the
  14190.                      result going to a new string
  14191.      
  14192.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  14193.      
  14194.  
  14195.  
  14196.  
  14197.  
  14198.  
  14199.  
  14200.  
  14201.  
  14202.  
  14203.  
  14204.  
  14205.  
  14206.  
  14207.  
  14208.      page 226            The Hobbit House String Library
  14209.  
  14210.  
  14211.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14212.      ║ COMAW.C      ║   file date: 03/13/93    page   2 of   2 ║ COMAW.C      ║
  14213.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14214.  
  14215.      
  14216.      
  14217.      usage example:  compiled/executed/verified on 12/16/92
  14218.      
  14219.                      char Astring[80] = "   1234567890      ";
  14220.                      char Bstring[80];
  14221.                      strcommanew(Bstring, Astring);
  14222.                      printf("%s", Bstring);
  14223.      
  14224.                      1,234,567,890
  14225.      
  14226.                               ┌───────────────────────┐
  14227.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14228.                               └───────────────────────┘                      */
  14229.  
  14230.  
  14231.  
  14232.  
  14233.  
  14234.  
  14235.  
  14236.  
  14237.  
  14238.  
  14239.  
  14240.  
  14241.  
  14242.  
  14243.  
  14244.  
  14245.  
  14246.  
  14247.  
  14248.  
  14249.  
  14250.  
  14251.  
  14252.  
  14253.  
  14254.  
  14255.  
  14256.  
  14257.  
  14258.  
  14259.  
  14260.  
  14261.  
  14262.  
  14263.  
  14264.  
  14265.  
  14266.  
  14267.  
  14268.  
  14269.                          The Hobbit House String Library               page 227
  14270.  
  14271.  
  14272.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14273.      ║ COMANW.C     ║   file date: 03/13/93    page   1 of   2 ║ COMANW.C     ║
  14274.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14275.  
  14276.      /*                       ┌───────────────────────┐            strcommannew
  14277.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  14278.                               └───────────────────────┘
  14279.                                copyright(c) 1992, 1993
  14280.      
  14281.      function:       strcommannew (STRing, add COMmas, to N-char size, to NEW)
  14282.      
  14283.      KWIC:           insert %commas into a string and pad the string on the
  14284.                                                                            left
  14285.                      to force %size
  14286.      
  14287.      syntax:         #include "hhstring.h"
  14288.                      char *strcommannew(char *newstring, char *instring,
  14289.                                         int nchar)
  14290.      
  14291.      description:    strips whitespace off of both sides of instring and then
  14292.                      adds commas every third place from the right so the result
  14293.                      is proper for decimal numbers. Pads with blanks on the
  14294.                      left so as to make the string nchar total characters long
  14295.                      and puts the result in newstring. Instring is unchanged.
  14296.      
  14297.      returns:        a pointer to the new string
  14298.      
  14299.      comments:       (1) the newstring space must be sufficient to hold the
  14300.                          result.
  14301.                      (2) the function works the same regardless of the
  14302.                          character contents of the input string; that is, it
  14303.                          will put commas every three spaces from the right in
  14304.                          ANY string, not just one which represents a decimal
  14305.                          number.
  14306.                      (3) Setting newstring = instring WILL NOT WORK with this
  14307.                          function and overlapping newstring/instring may or may
  14308.                          not work so if you must overlap, do it cautiously.
  14309.                      (4) The string pointed to by the return value of this
  14310.                          function is in the calling function's space. The
  14311.                          return value is provided as a convenience, not a
  14312.                          necessity.
  14313.      
  14314.      keywords:       string, commas, size, new
  14315.      
  14316.      key sentence:   inserts commas into a string and pad the string on the
  14317.                      left to force it to a given size, with the result being
  14318.                      put into a new string
  14319.      
  14320.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  14321.      
  14322.  
  14323.  
  14324.  
  14325.  
  14326.  
  14327.  
  14328.  
  14329.  
  14330.      page 228            The Hobbit House String Library
  14331.  
  14332.  
  14333.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14334.      ║ COMANW.C     ║   file date: 03/13/93    page   2 of   2 ║ COMANW.C     ║
  14335.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14336.  
  14337.      
  14338.      
  14339.      usage example:  compiled/executed/verified on 12/17/92
  14340.      
  14341.                      char Astring[80] = " 1234567890      ";
  14342.                      char Bstring[80];
  14343.                      strcommannew(Bstring, Astring, 15);
  14344.                      printf("-->%s<--", Bstring);
  14345.      
  14346.                      -->  1,234,567,890<--
  14347.      
  14348.                               ┌───────────────────────┐
  14349.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14350.                               └───────────────────────┘                      */
  14351.  
  14352.  
  14353.  
  14354.  
  14355.  
  14356.  
  14357.  
  14358.  
  14359.  
  14360.  
  14361.  
  14362.  
  14363.  
  14364.  
  14365.  
  14366.  
  14367.  
  14368.  
  14369.  
  14370.  
  14371.  
  14372.  
  14373.  
  14374.  
  14375.  
  14376.  
  14377.  
  14378.  
  14379.  
  14380.  
  14381.  
  14382.  
  14383.  
  14384.  
  14385.  
  14386.  
  14387.  
  14388.  
  14389.  
  14390.  
  14391.                          The Hobbit House String Library               page 229
  14392.  
  14393.  
  14394.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14395.      ║ COMATOI.C    ║   file date: 03/13/93    page   1 of   1 ║ COMATOI.C    ║
  14396.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14397.  
  14398.      /*                       ┌───────────────────────┐             strcommatoi
  14399.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  14400.                               └───────────────────────┘
  14401.                                copyright(c) 1992, 1993
  14402.      
  14403.      function:       strcommatoi (STRing with COMMAs to Integer)
  14404.      
  14405.      KWIC:           convert a string with %commas to an %integer
  14406.      
  14407.      syntax:         #include <stdlib.h>
  14408.                      #include "hhstring.h"
  14409.                      int strcommatoi(char *inpstring)
  14410.      
  14411.      description:    convert inpstring to an integer, ignoring leading
  14412.                      whitespace and all commas, but handling a minus sign
  14413.                      if there is one
  14414.      
  14415.      returns:        the integer value
  14416.      
  14417.      comments:       it is not a problem if inpstring has no commas
  14418.      
  14419.      keywords:       string, commas, convert, ASCII, decimal, integer, numeric
  14420.      
  14421.      key sentence:   converts an ASCII-decimal string with commas to an integer
  14422.      
  14423.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  14424.      
  14425.      usage example:  compiled/executed/verified on 12/17/92
  14426.      
  14427.                      char *Astring = "  -12,345";
  14428.                      printf("%d", strcommatoi(Astring));
  14429.      
  14430.                      -12345
  14431.      
  14432.                               ┌───────────────────────┐
  14433.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14434.                               └───────────────────────┘                      */
  14435.  
  14436.  
  14437.  
  14438.  
  14439.  
  14440.  
  14441.  
  14442.  
  14443.  
  14444.  
  14445.  
  14446.  
  14447.  
  14448.  
  14449.  
  14450.  
  14451.  
  14452.      page 230            The Hobbit House String Library
  14453.  
  14454.  
  14455.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14456.      ║ COMATOL.C    ║   file date: 03/13/93    page   1 of   1 ║ COMATOL.C    ║
  14457.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14458.  
  14459.      /*                       ┌───────────────────────┐             strcommatol
  14460.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  14461.                               └───────────────────────┘
  14462.                                copyright(c) 1992, 1993
  14463.      
  14464.      function:       strcommatol (STRing with COMMAs to Long)
  14465.      
  14466.      KWIC:           convert a string with %commas to a %long
  14467.      
  14468.      syntax:         #include "hhstring.h"
  14469.                      long int strcommatol(char *inpstring)
  14470.      
  14471.      description:    convert inpstring to a long integer, ignoring leading
  14472.                      whitespace and all commas but handling a minus sign if
  14473.                      there is one
  14474.      
  14475.      returns:        the long value
  14476.      
  14477.      comments:       it is not a problem if inpstring has no commas
  14478.      
  14479.      keywords:       string, commas, convert, ASCII, decimal, long
  14480.      
  14481.      key sentence:   converts an ASCII-decimal string with commas to a
  14482.                      long value
  14483.      
  14484.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  14485.      
  14486.      usage example:  compiled/executed/verified on 12/17/92
  14487.      
  14488.                      char *Astring = "   -1,000,000,000";
  14489.                      char *Bstring = "    1,000,000,000";
  14490.                      printf("\n%ld", strcommatol(Astring));
  14491.                      printf("\n%ld", strcommatol(Bstring));
  14492.      
  14493.                      -1000000000
  14494.                      1000000000
  14495.      
  14496.                               ┌───────────────────────┐
  14497.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14498.                               └───────────────────────┘                      */
  14499.  
  14500.  
  14501.  
  14502.  
  14503.  
  14504.  
  14505.  
  14506.  
  14507.  
  14508.  
  14509.  
  14510.  
  14511.  
  14512.  
  14513.                          The Hobbit House String Library               page 231
  14514.  
  14515.  
  14516.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14517.      ║ COMATOUI.C   ║   file date: 03/13/93    page   1 of   1 ║ COMATOUI.C   ║
  14518.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14519.  
  14520.      /*                       ┌───────────────────────┐            strcommatoui
  14521.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  14522.                               └───────────────────────┘
  14523.                                copyright(c) 1992, 1993
  14524.      
  14525.      function:       strcommatoui (STRing with COMMAs to Unsigned Integer)
  14526.      
  14527.      KWIC:           convert a string with %commas to an unsigned %integer
  14528.      
  14529.      syntax:         #include <stdlib>
  14530.                      #include "hhstring.h"
  14531.                      unsigned int strcommatoui(char *inpstring)
  14532.      
  14533.      description:    convert inpstring to an unsigned integer, ignoring any
  14534.                      leading whitespace and all commas
  14535.      
  14536.      returns:        the unsigned integer
  14537.      
  14538.      comments:       it is not a problem if inpstring has no commas
  14539.      
  14540.      keywords:       string, commas, convert, ASCII, decimal, integer
  14541.      
  14542.      key sentence:   converts an ASCII-decimal string with commas to an
  14543.                      unsigned integer
  14544.      
  14545.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  14546.      
  14547.      usage example:  compiled/executed/verified on 12/17/92
  14548.      
  14549.                      char *Astring = "    60,000";
  14550.                      printf("\n%u", strcommatoui(Astring));
  14551.      
  14552.                      60000
  14553.      
  14554.                               ┌───────────────────────┐
  14555.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14556.                               └───────────────────────┘                      */
  14557.  
  14558.  
  14559.  
  14560.  
  14561.  
  14562.  
  14563.  
  14564.  
  14565.  
  14566.  
  14567.  
  14568.  
  14569.  
  14570.  
  14571.  
  14572.  
  14573.  
  14574.      page 232            The Hobbit House String Library
  14575.  
  14576.  
  14577.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14578.      ║ COMATOUL.C   ║   file date: 03/13/93    page   1 of   1 ║ COMATOUL.C   ║
  14579.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14580.  
  14581.      /*                       ┌───────────────────────┐            strcommatoul
  14582.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  14583.                               └───────────────────────┘
  14584.                                copyright(c) 1992, 1993
  14585.      
  14586.      function:       strcommatoul (STRing with COMMAs to Unsigned Long)
  14587.      
  14588.      KWIC:           convert a string with %commas to an unsigned %long
  14589.      
  14590.      syntax:         #include "hhstring.h"
  14591.                      unsigned long int strcommatoul(char *inpstring)
  14592.      
  14593.      description:    convert inpstring to an unsigned long, ignoring any
  14594.                      whitespace and all commas
  14595.      
  14596.      returns:        the unsigned long value
  14597.      
  14598.      comments:       it is not a problem if inpstring has no commas
  14599.      
  14600.      keywords:       string, commas, convert, ASCII, decimal, long
  14601.      
  14602.      key sentence:   converts an ASCII-decimal string with commas to an
  14603.                      unsigned long value
  14604.      
  14605.      see also:       strcomma{f|n}{new}      strcomma<to|fr>{u}< i | l >
  14606.      
  14607.      usage example:  compiled/executed/verified on 12/17/92
  14608.      
  14609.                      char *Astring = "    4,000,000,000";
  14610.                      printf("\n%lu", strcommatol(Astring));
  14611.      
  14612.                      4000000000
  14613.      
  14614.                               ┌───────────────────────┐
  14615.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14616.                               └───────────────────────┘                      */
  14617.  
  14618.  
  14619.  
  14620.  
  14621.  
  14622.  
  14623.  
  14624.  
  14625.  
  14626.  
  14627.  
  14628.  
  14629.  
  14630.  
  14631.  
  14632.  
  14633.  
  14634.  
  14635.                          The Hobbit House String Library               page 233
  14636.  
  14637.  
  14638.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14639.      ║ DATE1.C      ║   file date: 03/13/93    page   1 of   1 ║ DATE1.C      ║
  14640.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14641.  
  14642.      /*                       ┌───────────────────────┐                strdate1
  14643.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  14644.                               └───────────────────────┘
  14645.                                copyright(c) 1992, 1993
  14646.      
  14647.      function:       strdate1 (STRing, create DATE string, format #1)
  14648.      
  14649.      KWIC:           create a string containing today's %date in format #1
  14650.      
  14651.      syntax:         #include "hhstring.h"
  14652.                      char *strdate1(char *date_string)
  14653.      
  14654.      description:    date_string is filled with a string containing today's
  14655.                      date in format #1
  14656.      
  14657.      returns:        a pointer to date_string
  14658.      
  14659.      comments:       ╔═════════════════════════════════════════════════════╗
  14660.                      ║                                                     ║
  14661.                      ║  Since there are no standards for the various data  ║
  14662.                      ║  formats handled by the HHSTRING library "strdaten" ║
  14663.                      ║  and "strdatecnv" functions, the numbering system   ║
  14664.                      ║  used is purely arbitrary. It is explained in the   ║
  14665.                      ║  file DATEINFO.DOC, which accompanies the library.  ║
  14666.                      ║                                                     ║
  14667.                      ╚═════════════════════════════════════════════════════╝
  14668.      
  14669.      keywords:       date
  14670.      
  14671.      key sentence:   creates a string containing today's date in format #1
  14672.                      (mm/dd/yy)
  14673.      
  14674.      see also:       strdate< 1 | 2 | 3 | 4 | 5 | 6 | 7 >    strdateconv
  14675.                      date_without    make_date_without
  14676.                      date_withpad    make_date_withpad
  14677.      
  14678.      usage example:  compiled/executed/verified on 1/1/93
  14679.      
  14680.                      see the file TESTDATE.C
  14681.      
  14682.                               ┌───────────────────────┐
  14683.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14684.                               └───────────────────────┘                      */
  14685.  
  14686.  
  14687.  
  14688.  
  14689.  
  14690.  
  14691.  
  14692.  
  14693.  
  14694.  
  14695.  
  14696.      page 234            The Hobbit House String Library
  14697.  
  14698.  
  14699.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14700.      ║ DATE2.C      ║   file date: 03/13/93    page   1 of   1 ║ DATE2.C      ║
  14701.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14702.  
  14703.      /*                       ┌───────────────────────┐                strdate2
  14704.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  14705.                               └───────────────────────┘
  14706.                                copyright(c) 1992, 1993
  14707.      
  14708.      function:       strdate2 (STRing, create DATE string, format #2)
  14709.      
  14710.      KWIC:           create a string containing today's %date in format #2
  14711.      
  14712.      syntax:         #include "hhstring.h"
  14713.                      char *strdate2(char *date_string)
  14714.      
  14715.      description:    date_string is filled with a string containing today's
  14716.                      date in format #2
  14717.      
  14718.      returns:        a pointer to date_string
  14719.      
  14720.      comments:       ╔═════════════════════════════════════════════════════╗
  14721.                      ║                                                     ║
  14722.                      ║  Since there are no standards for the various data  ║
  14723.                      ║  formats handled by the HHSTRING library "strdaten" ║
  14724.                      ║  and "strdatecnv" functions, the numbering system   ║
  14725.                      ║  used is purely arbitrary. It is explained in the   ║
  14726.                      ║  file DATEINFO.DOC, which accompanies the library.  ║
  14727.                      ║                                                     ║
  14728.                      ╚═════════════════════════════════════════════════════╝
  14729.      
  14730.      keywords:       date
  14731.      
  14732.      key sentence:   creates a string containing today's date in format #2
  14733.                      (mm-dd-yy)
  14734.      
  14735.      
  14736.      see also:       strdate< 1 | 2 | 3 | 4 | 5 | 6 | 7 >    strdateconv
  14737.                      date_without    make_date_without
  14738.                      date_withpad    make_date_withpad
  14739.      
  14740.      usage example:  compiled/executed/verified on 1/1/93
  14741.      
  14742.                      see the file TESTDATE.C
  14743.      
  14744.                               ┌───────────────────────┐
  14745.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14746.                               └───────────────────────┘                      */
  14747.  
  14748.  
  14749.  
  14750.  
  14751.  
  14752.  
  14753.  
  14754.  
  14755.  
  14756.  
  14757.                          The Hobbit House String Library               page 235
  14758.  
  14759.  
  14760.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14761.      ║ DATE3.C      ║   file date: 03/13/93    page   1 of   1 ║ DATE3.C      ║
  14762.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14763.  
  14764.      /*                       ┌───────────────────────┐                strdate3
  14765.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  14766.                               └───────────────────────┘
  14767.                                copyright(c) 1992, 1993
  14768.      
  14769.      function:       strdate3 (STRing, create DATE string, format #3)
  14770.      
  14771.      KWIC:           create a string containing today's %date in format #3
  14772.      
  14773.      syntax:         #include "hhstring.h"
  14774.                      char *strdate3(char *date_string)
  14775.      
  14776.      description:    date_string is filled with a string containing today's
  14777.                      date in format #3
  14778.      
  14779.      returns:        a pointer to date_string
  14780.      
  14781.      comments:       ╔═════════════════════════════════════════════════════╗
  14782.                      ║                                                     ║
  14783.                      ║  Since there are no standards for the various data  ║
  14784.                      ║  formats handled by the HHSTRING library "strdaten" ║
  14785.                      ║  and "strdatecnv" functions, the numbering system   ║
  14786.                      ║  used is purely arbitrary. It is explained in the   ║
  14787.                      ║  file DATEINFO.DOC, which accompanies the library.  ║
  14788.                      ║                                                     ║
  14789.                      ╚═════════════════════════════════════════════════════╝
  14790.      
  14791.      keywords:       date
  14792.      
  14793.      key sentence:   creates a string containing today's date in format #3
  14794.                      ( m/ d/yy)
  14795.      
  14796.      see also:       strdate< 1 | 2 | 3 | 4 | 5 | 6 | 7 >    strdateconv
  14797.                      date_without    make_date_without
  14798.                      date_withpad    make_date_withpad
  14799.      
  14800.      usage example:  compiled/executed/verified on 1/1/93
  14801.      
  14802.                      see the file TESTDATE.C
  14803.      
  14804.                               ┌───────────────────────┐
  14805.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14806.                               └───────────────────────┘                      */
  14807.  
  14808.  
  14809.  
  14810.  
  14811.  
  14812.  
  14813.  
  14814.  
  14815.  
  14816.  
  14817.  
  14818.      page 236            The Hobbit House String Library
  14819.  
  14820.  
  14821.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14822.      ║ DATE4.C      ║   file date: 03/13/93    page   1 of   1 ║ DATE4.C      ║
  14823.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14824.  
  14825.      /*                       ┌───────────────────────┐                strdate4
  14826.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  14827.                               └───────────────────────┘
  14828.                                copyright(c) 1992, 1993
  14829.      
  14830.      function:       strdate4 (STRing, create DATE string, format #4)
  14831.      
  14832.      KWIC:           create a string containing today's %date in format #4
  14833.      
  14834.      syntax:         #include "hhstring.h"
  14835.                      char *strdate4(char *date_string)
  14836.      
  14837.      description:    date_string is filled with a string containing today's
  14838.                      date in format #4
  14839.      
  14840.      returns:        a pointer to date_string
  14841.      
  14842.      comments:       ╔═════════════════════════════════════════════════════╗
  14843.                      ║                                                     ║
  14844.                      ║  Since there are no standards for the various data  ║
  14845.                      ║  formats handled by the HHSTRING library "strdaten" ║
  14846.                      ║  and "strdatecnv" functions, the numbering system   ║
  14847.                      ║  used is purely arbitrary. It is explained in the   ║
  14848.                      ║  file DATEINFO.DOC, which accompanies the library.  ║
  14849.                      ║                                                     ║
  14850.                      ╚═════════════════════════════════════════════════════╝
  14851.      
  14852.      keywords:       date
  14853.      
  14854.      key sentence:   creates a string containing today's date in format #4
  14855.                      ( m- d-yy)
  14856.      
  14857.      see also:       strdate< 1 | 2 | 3 | 4 | 5 | 6 | 7 >    strdateconv
  14858.                      date_without    make_date_without
  14859.                      date_withpad    make_date_withpad
  14860.      
  14861.      usage example:  compiled/executed/verified on 1/1/93
  14862.      
  14863.                      see the file TESTDATE.C
  14864.      
  14865.                               ┌───────────────────────┐
  14866.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14867.                               └───────────────────────┘                      */
  14868.  
  14869.  
  14870.  
  14871.  
  14872.  
  14873.  
  14874.  
  14875.  
  14876.  
  14877.  
  14878.  
  14879.                          The Hobbit House String Library               page 237
  14880.  
  14881.  
  14882.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14883.      ║ DATE5.C      ║   file date: 03/13/93    page   1 of   1 ║ DATE5.C      ║
  14884.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14885.  
  14886.      /*                       ┌───────────────────────┐                strdate5
  14887.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  14888.                               └───────────────────────┘
  14889.                                copyright(c) 1992, 1993
  14890.      
  14891.      function:       strdate5 (STRing, create DATE string, format #5)
  14892.      
  14893.      KWIC:           create a string containing today's %date in format #5
  14894.      
  14895.      syntax:         #include "hhstring.h"
  14896.                      char *strdate5(char *date_string)
  14897.      
  14898.      description:    date_string is filled with a string containing today's
  14899.                      date in format #5
  14900.      
  14901.      returns:        a pointer to date_string
  14902.      
  14903.      comments:       ╔═════════════════════════════════════════════════════╗
  14904.                      ║                                                     ║
  14905.                      ║  Since there are no standards for the various data  ║
  14906.                      ║  formats handled by the HHSTRING library "strdaten" ║
  14907.                      ║  and "strdatecnv" functions, the numbering system   ║
  14908.                      ║  used is purely arbitrary. It is explained in the   ║
  14909.                      ║  file DATEINFO.DOC, which accompanies the library.  ║
  14910.                      ║                                                     ║
  14911.                      ╚═════════════════════════════════════════════════════╝
  14912.      
  14913.      keywords:       date
  14914.      
  14915.      key sentence:   creates a string containing today's date in format #5
  14916.                      (m/d/yy)
  14917.      
  14918.      see also:       strdate< 1 | 2 | 3 | 4 | 5 | 6 | 7 >    strdateconv
  14919.                      date_without    make_date_without
  14920.                      date_withpad    make_date_withpad
  14921.      
  14922.      usage example:  compiled/executed/verified on 1/1/93
  14923.      
  14924.                      see the file TESTDATE.C
  14925.      
  14926.                               ┌───────────────────────┐
  14927.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14928.                               └───────────────────────┘                      */
  14929.  
  14930.  
  14931.  
  14932.  
  14933.  
  14934.  
  14935.  
  14936.  
  14937.  
  14938.  
  14939.  
  14940.      page 238            The Hobbit House String Library
  14941.  
  14942.  
  14943.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  14944.      ║ DATE6.C      ║   file date: 03/13/93    page   1 of   1 ║ DATE6.C      ║
  14945.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  14946.  
  14947.      /*                       ┌───────────────────────┐                strdate6
  14948.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  14949.                               └───────────────────────┘
  14950.                                copyright(c) 1992, 1993
  14951.      
  14952.      function:       strdate6 (STRing, create DATE string, format #6)
  14953.      
  14954.      KWIC:           create a string containing today's %date in format #6
  14955.      
  14956.      syntax:         #include "hhstring.h"
  14957.                      char *strdate6(char *date_string)
  14958.      
  14959.      description:    date_string is filled with a string containing today's
  14960.                      date in format #6
  14961.      
  14962.      returns:        a pointer to date_string
  14963.      
  14964.      comments:       ╔═════════════════════════════════════════════════════╗
  14965.                      ║                                                     ║
  14966.                      ║  Since there are no standards for the various data  ║
  14967.                      ║  formats handled by the HHSTRING library "strdaten" ║
  14968.                      ║  and "strdatecnv" functions, the numbering system   ║
  14969.                      ║  used is purely arbitrary. It is explained in the   ║
  14970.                      ║  file DATEINFO.DOC, which accompanies the library.  ║
  14971.                      ║                                                     ║
  14972.                      ╚═════════════════════════════════════════════════════╝
  14973.      
  14974.      keywords:       date
  14975.      
  14976.      key sentence:   creates a string containing today's date in format #6
  14977.                      (m-d-yy)
  14978.      
  14979.      see also:       strdate< 1 | 2 | 3 | 4 | 5 | 6 | 7 >    strdateconv
  14980.                      date_without    make_date_without
  14981.                      date_withpad    make_date_withpad
  14982.      
  14983.      usage example:  compiled/executed/verified on 1/1/93
  14984.      
  14985.                      see the file TESTDATE.C
  14986.      
  14987.                               ┌───────────────────────┐
  14988.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  14989.                               └───────────────────────┘                      */
  14990.  
  14991.  
  14992.  
  14993.  
  14994.  
  14995.  
  14996.  
  14997.  
  14998.  
  14999.  
  15000.  
  15001.                          The Hobbit House String Library               page 239
  15002.  
  15003.  
  15004.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15005.      ║ DATE7.C      ║   file date: 03/13/93    page   1 of   1 ║ DATE7.C      ║
  15006.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15007.  
  15008.      /*                       ┌───────────────────────┐                strdate7
  15009.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15010.                               └───────────────────────┘
  15011.                                copyright(c) 1992, 1993
  15012.      
  15013.      function:       strdate7 (STRing, create DATE string, format #7)
  15014.      
  15015.      KWIC:           create a string containing today's %date in format #7
  15016.      
  15017.      syntax:         #include "hhstring.h"
  15018.                      char *strdate7(char *date_string)
  15019.      
  15020.      description:    date_string is filled with a string containing today's
  15021.                      date in format #7
  15022.      
  15023.      returns:        a pointer to date_string
  15024.      
  15025.      comments:       ╔═════════════════════════════════════════════════════╗
  15026.                      ║                                                     ║
  15027.                      ║  Since there are no standards for the various data  ║
  15028.                      ║  formats handled by the HHSTRING library "strdaten" ║
  15029.                      ║  and "strdatecnv" functions, the numbering system   ║
  15030.                      ║  used is purely arbitrary. It is explained in the   ║
  15031.                      ║  file DATEINFO.DOC, which accompanies the library.  ║
  15032.                      ║                                                     ║
  15033.                      ╚═════════════════════════════════════════════════════╝
  15034.      
  15035.      keywords:       date
  15036.      
  15037.      key sentence:   creates a string containing today's date in format #7
  15038.                      (yy/mm/dd)
  15039.      
  15040.      see also:       strdate< 1 | 2 | 3 | 4 | 5 | 6 | 7 >    strdateconv
  15041.                      date_without    make_date_without
  15042.                      date_withpad    make_date_withpad
  15043.      
  15044.      usage example:  compiled/executed/verified on 1/1/93
  15045.      
  15046.                      see the file TESTDATE.C
  15047.      
  15048.                               ┌───────────────────────┐
  15049.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  15050.                               └───────────────────────┘                      */
  15051.  
  15052.  
  15053.  
  15054.  
  15055.  
  15056.  
  15057.  
  15058.  
  15059.  
  15060.  
  15061.  
  15062.      page 240            The Hobbit House String Library
  15063.  
  15064.  
  15065.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15066.      ║ DATECNV.C    ║   file date: 03/13/93    page   1 of   1 ║ DATECNV.C    ║
  15067.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15068.  
  15069.      /*                       ┌───────────────────────┐             strdateconv
  15070.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15071.                               └───────────────────────┘
  15072.                                copyright(c) 1992, 1993
  15073.      
  15074.      function:       strdateconv --- (STRing, DATE, CONVert format)
  15075.      
  15076.      KWIC:           %convert a %date string, in any specified format, to any
  15077.                      other specified format (see comments, below)
  15078.      
  15079.      syntax:         #include <dos.h>
  15080.                      #include <stdlib.h>
  15081.                      #include "hhstring.h"
  15082.                      char *strdateconv(char *date_string, int intype,
  15083.                                        int outtype)
  15084.      
  15085.      description:    date_string is converted from the intype format to the
  15086.                      outtype format
  15087.      
  15088.      returns:        a pointer to date_string (or a NULL if the intype or
  15089.                      outtype parameters are illegal)
  15090.      
  15091.      comments:       ╔═════════════════════════════════════════════════════╗
  15092.                      ║                                                     ║
  15093.                      ║  Since there are no standards for the various data  ║
  15094.                      ║  formats handled by the HHSTRING library "strdaten" ║
  15095.                      ║  and "strdatecnv" functions, the numbering system   ║
  15096.                      ║  used is purely arbitrary. It is explained in the   ║
  15097.                      ║  file DATEINFO.DOC, which accompanies the library.  ║
  15098.                      ║                                                     ║
  15099.                      ╚═════════════════════════════════════════════════════╝
  15100.      
  15101.      keywords:       date, convert
  15102.      
  15103.      key sentence:   converts a date string from one format to another
  15104.      
  15105.      see also:       strdate< 1 | 2 | 3 | 4 | 5 | 6 | 7 >    strdateconv
  15106.                      date_without    make_date_without
  15107.                      date_withpad    make_date_withpad
  15108.      
  15109.      usage example:  compiled/executed/verified on 2/25/93
  15110.      
  15111.      
  15112.                      see the file TESTDATE.C
  15113.      
  15114.      
  15115.                               ┌───────────────────────┐
  15116.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  15117.                               └───────────────────────┘                      */
  15118.  
  15119.  
  15120.  
  15121.  
  15122.  
  15123.                          The Hobbit House String Library               page 241
  15124.  
  15125.  
  15126.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15127.      ║ END.C        ║   file date: 03/13/93    page   1 of   1 ║ END.C        ║
  15128.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15129.  
  15130.      /*                       ┌───────────────────────┐                  strend
  15131.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15132.                               └───────────────────────┘
  15133.                                copyright(c) 1992, 1993
  15134.      
  15135.      function:       strend (get STRing END)
  15136.      
  15137.      KWIC:           get a pointer to the %end of the string (the '\0')
  15138.      
  15139.      syntax:         #include "hhstring.h"
  15140.                      char *strend(char *instring)
  15141.      
  15142.      description:    returns a pointer to the string terminator
  15143.      
  15144.      returns:        a pointer to the string terminator
  15145.      
  15146.      comments:       none
  15147.      
  15148.      keywords:       string, end
  15149.      
  15150.      key sentence:   gets the pointer to the end of a string (that is, to the
  15151.                      terminating '\0' of the string)
  15152.      
  15153.      see also:       --- no related functions ---
  15154.      
  15155.      usage example:  compiled/executed/verified on 12/13/92
  15156.      
  15157.                      char *Astring = "first string\0second string";
  15158.                      printf("%s", strend(Astring) + 1);
  15159.      
  15160.                      second string
  15161.      
  15162.                               ┌───────────────────────┐
  15163.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  15164.                               └───────────────────────┘                      */
  15165.  
  15166.  
  15167.  
  15168.  
  15169.  
  15170.  
  15171.  
  15172.  
  15173.  
  15174.  
  15175.  
  15176.  
  15177.  
  15178.  
  15179.  
  15180.  
  15181.  
  15182.  
  15183.  
  15184.      page 242            The Hobbit House String Library
  15185.  
  15186.  
  15187.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15188.      ║ EOS.C        ║   file date: 03/13/93    page   1 of   1 ║ EOS.C        ║
  15189.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15190.  
  15191.      /*                       ┌───────────────────────┐                  streos
  15192.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15193.                               └───────────────────────┘
  15194.                                copyright(c) 1992, 1993
  15195.      
  15196.      function:       streos (STRing, set to all End-Of-String)
  15197.      
  15198.      KWIC:           set a string to all binary %zeros
  15199.      
  15200.      syntax:         #include "hhstring.h"
  15201.                      char *streos(char *instring)
  15202.      
  15203.      description:    takes a string which has a terminating '\0' and fills it
  15204.                      with '\0' characters
  15205.      
  15206.      returns:        a pointer to the string
  15207.      
  15208.      comments:       this is a macro defined in hhstring.h as:
  15209.      
  15210.                      #define streos(s)       strset(s, '\0')
  15211.      
  15212.      keywords:       string, character, set
  15213.      
  15214.      key sentence:   sets a string to all binary zeros (EOSs)
  15215.      
  15216.      see also:       str< blank | eos | set | zero >
  15217.      
  15218.      usage example:  compiled/executed/verified on 12/13/92
  15219.      
  15220.                      int ii;
  15221.                      char *instring = "this string";
  15222.                      streos(instring);
  15223.                      for (ii = 0; ii < 11; ii++)
  15224.                        printf("%d ", instring[ii]);
  15225.      
  15226.                      0 0 0 0 0 0 0 0 0 0 0
  15227.      
  15228.                               ┌───────────────────────┐
  15229.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  15230.                               └───────────────────────┘                      */
  15231.  
  15232.  
  15233.  
  15234.  
  15235.  
  15236.  
  15237.  
  15238.  
  15239.  
  15240.  
  15241.  
  15242.  
  15243.  
  15244.  
  15245.                          The Hobbit House String Library               page 243
  15246.  
  15247.  
  15248.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15249.      ║ FROMC.C      ║   file date: 03/13/93    page   1 of   2 ║ FROMC.C      ║
  15250.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15251.  
  15252.      /*                       ┌───────────────────────┐                strfromc
  15253.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15254.                               └───────────────────────┘
  15255.                                copyright(c) 1992, 1993
  15256.      
  15257.      function:       strfromc (STRing FROM C-sequence string)
  15258.      
  15259.      KWIC:           %convert a string containing %C-sequence format characters
  15260.                      to a string having only normal (non-C) format characters
  15261.      
  15262.      syntax:         #include "hhstring.h"
  15263.                      int strfromc(char *instring)
  15264.      
  15265.      description:    a string which contains C-sequence "characters" (see the
  15266.                      full list with the function strchrfromc) is converted to
  15267.                      a string which has only single-character representations
  15268.                      of the same information. That is, if the input string
  15269.                      contains, for example, the C language representation of
  15270.                      backslash ('\t') then the converted string will have a
  15271.                      backslash character (hex 5C) in place of the 2-character
  15272.                      C language representation.
  15273.      
  15274.      returns:        the number of characters in the converted string
  15275.      
  15276.      comments:       note that the conversion is done "in place" so no new
  15277.                      string space is required. The primary work of this
  15278.                      function is the performed by the function strchrfromc.
  15279.      
  15280.      keywords:       string, convert, C-sequence
  15281.      
  15282.      key sentence:   converts a string containing C-sequence format characters
  15283.                      to a string having only normal (non-C) format characters
  15284.      
  15285.      see also:       str{chr}<to | from>c
  15286.      
  15287.  
  15288.  
  15289.  
  15290.  
  15291.  
  15292.  
  15293.  
  15294.  
  15295.  
  15296.  
  15297.  
  15298.  
  15299.  
  15300.  
  15301.  
  15302.  
  15303.  
  15304.  
  15305.  
  15306.      page 244            The Hobbit House String Library
  15307.  
  15308.  
  15309.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15310.      ║ FROMC.C      ║   file date: 03/13/93    page   2 of   2 ║ FROMC.C      ║
  15311.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15312.  
  15313.      
  15314.      
  15315.      usage example:  compiled/executed/verified on 12/13/92
  15316.      
  15317.                      char str[80] = "a\\t\\142";
  15318.                      int ii;
  15319.                      strfromc(str);
  15320.                      printf("\n\n");
  15321.                      for (ii = 0; ii < 4; ii++)
  15322.                        printf("%d ", str[ii]);
  15323.      
  15324.                      97 9 98 0                               note: a TAB b
  15325.      
  15326.                               ┌───────────────────────┐
  15327.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  15328.                               └───────────────────────┘                      */
  15329.  
  15330.  
  15331.  
  15332.  
  15333.  
  15334.  
  15335.  
  15336.  
  15337.  
  15338.  
  15339.  
  15340.  
  15341.  
  15342.  
  15343.  
  15344.  
  15345.  
  15346.  
  15347.  
  15348.  
  15349.  
  15350.  
  15351.  
  15352.  
  15353.  
  15354.  
  15355.  
  15356.  
  15357.  
  15358.  
  15359.  
  15360.  
  15361.  
  15362.  
  15363.  
  15364.  
  15365.  
  15366.  
  15367.                          The Hobbit House String Library               page 245
  15368.  
  15369.  
  15370.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15371.      ║ INDEX.C      ║   file date: 03/13/93    page   1 of   1 ║ INDEX.C      ║
  15372.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15373.  
  15374.      /*                       ┌───────────────────────┐                strindex
  15375.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15376.                               └───────────────────────┘
  15377.                                copyright(c) 1992, 1993
  15378.      
  15379.      function:       strindex (STRing function, get the INDEX of a pointer)
  15380.      
  15381.      KWIC:           get the %index of a pointer in a string
  15382.      
  15383.      syntax:         #include "hhstring.h"
  15384.                      int strindex(char *ptr, char *str)
  15385.      
  15386.      description:    str is incremented until it equals ptr; the number of
  15387.                      increments required is the return value of the function.
  15388.                      This is, of course, the index of ptr from str.
  15389.      
  15390.      returns:        the index
  15391.      
  15392.      comments:       if ptr precedes str, then this function will count until
  15393.                      the incremented str wraps all the way around and
  15394.                      eventually becomes equal to ptr
  15395.      
  15396.      keywords:       string, index
  15397.      
  15398.      key sentence:   gets the index of a pointer inside a string
  15399.      
  15400.      see also:       --- no related functions ---
  15401.      
  15402.      usage example:  compiled/executed/verified on 2/21/93
  15403.      
  15404.                      char Astring[80];
  15405.                      printf("\n%d", strindex(Astring + 15, Astring));
  15406.                      printf("\n%d", strindex(Astring, Astring + 15));
  15407.      
  15408.                      15
  15409.                      -15
  15410.      
  15411.                               ┌───────────────────────┐
  15412.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  15413.                               └───────────────────────┘                      */
  15414.  
  15415.  
  15416.  
  15417.  
  15418.  
  15419.  
  15420.  
  15421.  
  15422.  
  15423.  
  15424.  
  15425.  
  15426.  
  15427.  
  15428.      page 246            The Hobbit House String Library
  15429.  
  15430.  
  15431.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15432.      ║ INSERT.C     ║   file date: 03/13/93    page   1 of   1 ║ INSERT.C     ║
  15433.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15434.  
  15435.      /*                       ┌───────────────────────┐               strinsert
  15436.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15437.                               └───────────────────────┘
  15438.                                copyright(c) 1992, 1993
  15439.      
  15440.      function:       strinsert (STRing, INSERT one string into another)
  15441.      
  15442.      KWIC:           %insert one string into another string
  15443.      
  15444.      syntax:         #include "hhstring.h"
  15445.                      char *strinsert(char *instring, int putplace,
  15446.                                      char *putstring)
  15447.      
  15448.      description:    inserts putstring into instring at position putplace
  15449.      
  15450.      returns:        a pointer to instring
  15451.      
  15452.      comments:       instring has to include enough memory space to accommodate
  15453.                      the insertion of putstring, else there be dragons
  15454.      
  15455.                      putplace is 0-origin, so to insert the new string
  15456.                      entirely in front of the existing string, use putplace = 0
  15457.      
  15458.                      if putplace points at the terminating EOS, this function
  15459.                      acts like a concatenate.
  15460.      
  15461.                      The string pointed to by the return value of this function
  15462.                      is in the calling function's space. The return value is
  15463.                      provided as a convenience, not a necessity.
  15464.      
  15465.      keywords:       string, insert
  15466.      
  15467.      key sentence:   inserts one string into another string
  15468.      
  15469.      see also:       strinsert{new}
  15470.      
  15471.      usage example:  compiled/executed/verified on 12/13/92
  15472.      
  15473.                      char str[80] = "This is the original string";
  15474.                      strinsert(str, 8, "not ");
  15475.                      printf("%s", str);
  15476.      
  15477.                      This is not the original string
  15478.      
  15479.                               ┌───────────────────────┐
  15480.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  15481.                               └───────────────────────┘                      */
  15482.  
  15483.  
  15484.  
  15485.  
  15486.  
  15487.  
  15488.  
  15489.                          The Hobbit House String Library               page 247
  15490.  
  15491.  
  15492.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15493.      ║ INSERTW.C    ║   file date: 03/13/93    page   1 of   2 ║ INSERTW.C    ║
  15494.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15495.  
  15496.      /*                       ┌───────────────────────┐            strinsertnew
  15497.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15498.                               └───────────────────────┘
  15499.                                copyright(c) 1992, 1993
  15500.      
  15501.      function:       strinsertnew (STRing, INSERT one string into another and
  15502.                                    put the result in a NEW string)
  15503.      
  15504.      KWIC:           %insert one string into another string
  15505.      
  15506.      syntax:         #include "hhstring.h"
  15507.                      char *strinsertnew(char *newstring, char *instring,
  15508.                                         int putplace, char *putstring)
  15509.      
  15510.      description:    copies instring, up to putplace, into newstring, then
  15511.                      concatenates putstring onto newstring, then concatenates
  15512.                      the rest of instring onto newstring.
  15513.      
  15514.      returns:        a pointer to newstring
  15515.      
  15516.      comments:       newstring has to include enough memory space to
  15517.                      accommodate the instring plus putstring, else there
  15518.                      be dragons
  15519.      
  15520.                      putplace is 0-origin, so to insert the new string
  15521.                      entirely in front of the existing string, use putplace = 0
  15522.      
  15523.                      if putplace points at the terminating EOS, this function
  15524.                      acts like a concatenate.
  15525.      
  15526.                      The string pointed to by the return value of this function
  15527.                      is in the calling function's space. The return value is
  15528.                      provided as a convenience, not a necessity.
  15529.      
  15530.      keywords:       string, insert, new
  15531.      
  15532.      key sentence:   inserts one string into another string and puts the result
  15533.                      into a new string
  15534.      
  15535.      see also:       strinsert{new}
  15536.      
  15537.  
  15538.  
  15539.  
  15540.  
  15541.  
  15542.  
  15543.  
  15544.  
  15545.  
  15546.  
  15547.  
  15548.  
  15549.  
  15550.      page 248            The Hobbit House String Library
  15551.  
  15552.  
  15553.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15554.      ║ INSERTW.C    ║   file date: 03/13/93    page   2 of   2 ║ INSERTW.C    ║
  15555.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15556.  
  15557.      
  15558.      
  15559.      usage example:  compiled/executed/verified on 12/13/92
  15560.      
  15561.                      char *Astring = "This is the original string";
  15562.                      char Bstring[80];
  15563.                      strinsertnew(Bstring, Astring, 8, "not ");
  15564.                      printf("%s", Bstring);
  15565.      
  15566.                      This is not the original string
  15567.      
  15568.                               ┌───────────────────────┐
  15569.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  15570.                               └───────────────────────┘                      */
  15571.  
  15572.  
  15573.  
  15574.  
  15575.  
  15576.  
  15577.  
  15578.  
  15579.  
  15580.  
  15581.  
  15582.  
  15583.  
  15584.  
  15585.  
  15586.  
  15587.  
  15588.  
  15589.  
  15590.  
  15591.  
  15592.  
  15593.  
  15594.  
  15595.  
  15596.  
  15597.  
  15598.  
  15599.  
  15600.  
  15601.  
  15602.  
  15603.  
  15604.  
  15605.  
  15606.  
  15607.  
  15608.  
  15609.  
  15610.  
  15611.                          The Hobbit House String Library               page 249
  15612.  
  15613.  
  15614.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15615.      ║ ISEMPTY.C    ║   file date: 03/13/93    page   1 of   2 ║ ISEMPTY.C    ║
  15616.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15617.  
  15618.      /*                       ┌───────────────────────┐              strisempty
  15619.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15620.                               └───────────────────────┘
  15621.                                copyright(c) 1992, 1993
  15622.      
  15623.      function:       strisempty (STRing IS it an EMPTY string?)
  15624.      
  15625.      KWIC:           report on whether or not a string is %empty
  15626.      
  15627.                      That is, whether or not it is either a NULL string or has
  15628.                      only characters from the following set:
  15629.                              ' '     blank
  15630.                              '\n'    line feed (aka "end of line")
  15631.                              '\t'    tab (horizontal)
  15632.                              '\v'    vertical tab
  15633.                              '\f'    form feed
  15634.                              '\r'    carriage return
  15635.      
  15636.      syntax:         #include "hhstring.h"
  15637.                      int strisempty(char *instring)
  15638.      
  15639.      description:    instring is scanned for any of the characters show above
  15640.                      under "purpose" and the return specifies whether or not
  15641.                      any OTHER characters were found.
  15642.      
  15643.      returns:        non-zero if string is empty or contains only the
  15644.                      specified "empty" characters
  15645.      
  15646.      comments:       note the difference between this function and
  15647.                      striswhite, which only checks for blanks and tabs
  15648.      
  15649.      keywords:       string, is, character
  15650.      
  15651.      key sentence:   tells whether or not a string is empty (i.e. contains no
  15652.                      characters or only characters from the C-sequence set
  15653.                      " \n\t\v\f\r")
  15654.      
  15655.      see also:       stris< empty | white >
  15656.      
  15657.  
  15658.  
  15659.  
  15660.  
  15661.  
  15662.  
  15663.  
  15664.  
  15665.  
  15666.  
  15667.  
  15668.  
  15669.  
  15670.  
  15671.  
  15672.      page 250            The Hobbit House String Library
  15673.  
  15674.  
  15675.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15676.      ║ ISEMPTY.C    ║   file date: 03/13/93    page   2 of   2 ║ ISEMPTY.C    ║
  15677.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15678.  
  15679.      
  15680.      
  15681.      usage example:  compiled/executed/verified on 12/13/92
  15682.      
  15683.                      char *Astring = " \t \v \n";
  15684.                      char *Bstring = "";
  15685.                      char *Cstring = "not empty";
  15686.                      printf("\n%d", strisempty(Astring));
  15687.                      printf("\n%d", strisempty(Bstring));
  15688.                      printf("\n%d", strisempty(Cstring));
  15689.      
  15690.                      1
  15691.                      1
  15692.                      0
  15693.      
  15694.      
  15695.                               ┌───────────────────────┐
  15696.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  15697.                               └───────────────────────┘                      */
  15698.  
  15699.  
  15700.  
  15701.  
  15702.  
  15703.  
  15704.  
  15705.  
  15706.  
  15707.  
  15708.  
  15709.  
  15710.  
  15711.  
  15712.  
  15713.  
  15714.  
  15715.  
  15716.  
  15717.  
  15718.  
  15719.  
  15720.  
  15721.  
  15722.  
  15723.  
  15724.  
  15725.  
  15726.  
  15727.  
  15728.  
  15729.  
  15730.  
  15731.  
  15732.  
  15733.                          The Hobbit House String Library               page 251
  15734.  
  15735.  
  15736.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15737.      ║ ISWHITE.C    ║   file date: 03/13/93    page   1 of   1 ║ ISWHITE.C    ║
  15738.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15739.  
  15740.      /*                       ┌───────────────────────┐              striswhite
  15741.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15742.                               └───────────────────────┘
  15743.                                copyright(c) 1992, 1993
  15744.      
  15745.      function:       striswhite (STRing IS it a WHITE string?)
  15746.      
  15747.      KWIC:           report on whether or not a string is "white" (contains
  15748.                      only %whitespace, or is NULL)
  15749.      
  15750.      syntax:         #include "hhstring.h"
  15751.                      int striswhite(char *instring)
  15752.      
  15753.      description:    instring is scanned for any non-whitespace characters
  15754.      
  15755.      returns:        non-zero if string is NULL or contains only whitespace,
  15756.                      0 otherwise.
  15757.      
  15758.      comments:       to check for truly empty lines, use strisempty. In
  15759.                      particular, lines with nothing but a '\n' in them are
  15760.                      NOT white but they are empty
  15761.      
  15762.      keywords:       string, is, character, whitespace, blank, tab
  15763.      
  15764.      key sentence:   tells whether or not a string is "white" (contains only
  15765.                      whitespace) or is NULL
  15766.      
  15767.      see also:       stris< empty | white >
  15768.      
  15769.      usage example:  compiled/executed/verified on 12/13/92
  15770.      
  15771.                      char *Astring = "   \t ";
  15772.                      char *Bstring = "\n";
  15773.                      char *Cstring = "not empty";
  15774.                      printf("\n%d", striswhite(Astring));
  15775.                      printf("\n%d", striswhite(Bstring));
  15776.                      printf("\n%d", striswhite(Cstring));
  15777.      
  15778.                      1
  15779.                      0
  15780.                      0
  15781.      
  15782.                               ┌───────────────────────┐
  15783.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  15784.                               └───────────────────────┘                      */
  15785.  
  15786.  
  15787.  
  15788.  
  15789.  
  15790.  
  15791.  
  15792.  
  15793.  
  15794.      page 252            The Hobbit House String Library
  15795.  
  15796.  
  15797.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15798.      ║ LEFT.C       ║   file date: 03/13/93    page   1 of   1 ║ LEFT.C       ║
  15799.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15800.  
  15801.      /*                       ┌───────────────────────┐                 strleft
  15802.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15803.                               └───────────────────────┘
  15804.                                copyright(c) 1992, 1993
  15805.      
  15806.      function:       strleft (STRing LEFT)
  15807.      
  15808.      KWIC:           get n characters from the %left side of a string
  15809.      
  15810.      syntax:         #include "hhstring.h"
  15811.                      char *strleft(char *instring, int nchar)
  15812.      
  15813.      description:    modify the position of the terminating EOS of instring, so
  15814.                      that instring effectively contains only the nchar
  15815.                      characters from the left side of the original instring. If
  15816.                      the original instring is shorter than nchars, then it
  15817.                      remains unchanged
  15818.      
  15819.      returns:        a pointer to instring
  15820.      
  15821.      comments:       The string pointed to by the return value of this function
  15822.                      is in the calling function's space. The return value is
  15823.                      provided as a convenience, not a necessity.
  15824.      
  15825.      keywords:       string, left, truncate
  15826.      
  15827.      key sentence:   truncates a string by deleting all but the leftmost n
  15828.                      characters, and returns a pointer to the modified string
  15829.      
  15830.      see also:       strleft{new}    strmid{new}
  15831.                      strright{new}   strmidn{new}
  15832.      
  15833.      usage example:  compiled/executed/verified on 12/13/92
  15834.      
  15835.                      char *Astring = "name size date other";
  15836.                      strleft(Astring, 9);
  15837.                      printf("%s", Astring);
  15838.      
  15839.                      name size
  15840.      
  15841.                               ┌───────────────────────┐
  15842.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  15843.                               └───────────────────────┘                      */
  15844.  
  15845.  
  15846.  
  15847.  
  15848.  
  15849.  
  15850.  
  15851.  
  15852.  
  15853.  
  15854.  
  15855.                          The Hobbit House String Library               page 253
  15856.  
  15857.  
  15858.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15859.      ║ LEFTW.C      ║   file date: 03/13/93    page   1 of   1 ║ LEFTW.C      ║
  15860.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15861.  
  15862.      /*                       ┌───────────────────────┐              strleftnew
  15863.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15864.                               └───────────────────────┘
  15865.                                copyright(c) 1992, 1993
  15866.      
  15867.      function:       strleftnew (STRing LEFT to NEW string)
  15868.      
  15869.      KWIC:           get n chars from the %left side of a string
  15870.      
  15871.      syntax:         #include "hhstring.h"
  15872.                      char *strleftnew(char *newstring, char *instring,
  15873.                                       int nchar)
  15874.      
  15875.      description:    move the nchar characters on the left side of instring to
  15876.                      newstring. If nchar is larger than instring, then
  15877.                      newstring will be the same as instring. In any case,
  15878.                      instring is unchanged.
  15879.      
  15880.      returns:        a pointer to newstring
  15881.      
  15882.      comments:       The string pointed to by the return value of this function
  15883.                      is in the calling function's space. The return value is
  15884.                      provided as a convenience, not a necessity.
  15885.      
  15886.                      Setting newstring = instring will work OK with this
  15887.                      function but overlapping newstring/instring may or may
  15888.                      not work so if you must overlap, do it cautiously.
  15889.      
  15890.      keywords:       string, left, new, truncate
  15891.      
  15892.      key sentence:   creates a string which consist of the leftmost n
  15893.                      characters from a given string, and returns a pointer to
  15894.                      the new string
  15895.      
  15896.      see also:       strleft{new}    strmid{new}
  15897.                      strright{new}   strmidn{new}
  15898.      
  15899.      usage example:  compiled/executed/verified on 1/19/93
  15900.      
  15901.                      char *Astring = "name size date other";
  15902.                      char Newstring[80];
  15903.                      strleftnew(Newstring, Astring, 9);
  15904.                      printf("%s", Newstring);
  15905.      
  15906.                      name size
  15907.      
  15908.                               ┌───────────────────────┐
  15909.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  15910.                               └───────────────────────┘                      */
  15911.  
  15912.  
  15913.  
  15914.  
  15915.  
  15916.      page 254            The Hobbit House String Library
  15917.  
  15918.  
  15919.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15920.      ║ LENMAX.C     ║   file date: 03/13/93    page   1 of   1 ║ LENMAX.C     ║
  15921.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15922.  
  15923.      /*                       ┌───────────────────────┐               strlenmax
  15924.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15925.                               └───────────────────────┘
  15926.                                copyright(c) 1992, 1993
  15927.      
  15928.      function:       strlenmax (STRing LENgth MAXimum function)
  15929.      
  15930.      KWIC:           get the %larger of a number and the %length of a string
  15931.      
  15932.      syntax:         #include "hhstring.h"
  15933.                      int strlenmax(char *string, int number);
  15934.      
  15935.      description:    given a string and a number, this function returns the
  15936.                      larger of the number and the length of the string
  15937.      
  15938.      returns:        the larger integer value (string length or input number)
  15939.      
  15940.      comments:       none
  15941.      
  15942.      keywords:       string, length
  15943.      
  15944.      key sentence:   gets the larger of a number or the length of a string
  15945.      
  15946.      see also:       strl< max | min >
  15947.      
  15948.      usage example:  compiled/executed/verified on 12/13/92
  15949.      
  15950.                      printf ("\n%d", strlenmax("this string",  8));
  15951.                      printf ("\n%d", strlenmax("this string", 20));
  15952.      
  15953.                      11
  15954.                      20
  15955.      
  15956.                               ┌───────────────────────┐
  15957.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  15958.                               └───────────────────────┘                      */
  15959.  
  15960.  
  15961.  
  15962.  
  15963.  
  15964.  
  15965.  
  15966.  
  15967.  
  15968.  
  15969.  
  15970.  
  15971.  
  15972.  
  15973.  
  15974.  
  15975.  
  15976.  
  15977.                          The Hobbit House String Library               page 255
  15978.  
  15979.  
  15980.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  15981.      ║ LENMIN.C     ║   file date: 03/13/93    page   1 of   1 ║ LENMIN.C     ║
  15982.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  15983.  
  15984.      /*                       ┌───────────────────────┐               strlenmin
  15985.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  15986.                               └───────────────────────┘
  15987.                                copyright(c) 1992, 1993
  15988.      
  15989.      function:       strlenmin (STRing LENgth MINimum function)
  15990.      
  15991.      KWIC:           get the %smaller of a number and the %length of a string
  15992.      
  15993.      syntax:         #include "hhstring.h"
  15994.                      int strlenmin(char *string, int number);
  15995.      
  15996.      description:    given a string and a number, this function returns the
  15997.                      smaller of the number and the length of the string
  15998.      
  15999.      returns:        the smaller integer value (string length or input number)
  16000.      
  16001.      comments:       none
  16002.      
  16003.      keywords:       string, length
  16004.      
  16005.      key sentence:   gets the smaller of a number or the length of a string
  16006.      
  16007.      see also:       strl< max | min >
  16008.      
  16009.      usage example:  compiled/executed/verified on 12/13/92
  16010.      
  16011.                      printf ("\n%d", strlenmin("this string",  8));
  16012.                      printf ("\n%d", strlenmin("this string", 20));
  16013.      
  16014.                      8
  16015.                      11
  16016.      
  16017.                               ┌───────────────────────┐
  16018.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16019.                               └───────────────────────┘                      */
  16020.  
  16021.  
  16022.  
  16023.  
  16024.  
  16025.  
  16026.  
  16027.  
  16028.  
  16029.  
  16030.  
  16031.  
  16032.  
  16033.  
  16034.  
  16035.  
  16036.  
  16037.  
  16038.      page 256            The Hobbit House String Library
  16039.  
  16040.  
  16041.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16042.      ║ LEFTDEL.C    ║   file date: 03/13/93    page   1 of   1 ║ LEFTDEL.C    ║
  16043.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16044.  
  16045.      /*                       ┌───────────────────────┐                strlfdel
  16046.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16047.                               └───────────────────────┘
  16048.                                copyright(c) 1992, 1993
  16049.      
  16050.      function:       strlfdel (STRing LeFt DELete)
  16051.      
  16052.      KWIC:           %delete characters on the %left side of a string
  16053.      
  16054.      syntax:         #include "hhstring.h"
  16055.                      char *strlfdel (char *instring, int nchar)
  16056.      
  16057.      description:    modifies instring so that the leftmost nchar characters
  16058.                      are truncated from the string
  16059.      
  16060.      returns:        a pointer to instring
  16061.      
  16062.      comments:       If nchar is greater than the length of instring, then this
  16063.                      function sets instring to a null string and does not
  16064.                      disturb the rest of memory.
  16065.      
  16066.                      The string pointed to by the return value of this function
  16067.                      is in the calling function's space. The return value is
  16068.                      provided as a convenience, not a necessity.
  16069.      
  16070.      keywords:       string, left, delete, truncate
  16071.      
  16072.      key sentence:   truncates a string by deleting the leftmost n characters,
  16073.                      and returns a pointer to the modified string
  16074.      
  16075.      see also:       str< lf | mid | rt >del{new}
  16076.      
  16077.      usage example:  compiled/executed/verified on 12/13/92
  16078.      
  16079.                      char *Astring = "this is Astring";
  16080.                      strlfdel(Astring, 5);
  16081.                      printf("%s", Astring);
  16082.      
  16083.                      is Astring
  16084.      
  16085.                               ┌───────────────────────┐
  16086.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16087.                               └───────────────────────┘                      */
  16088.  
  16089.  
  16090.  
  16091.  
  16092.  
  16093.  
  16094.  
  16095.  
  16096.  
  16097.  
  16098.  
  16099.                          The Hobbit House String Library               page 257
  16100.  
  16101.  
  16102.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16103.      ║ LEFTDELW.C   ║   file date: 03/13/93    page   1 of   1 ║ LEFTDELW.C   ║
  16104.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16105.  
  16106.      /*                       ┌───────────────────────┐             strlfdelnew
  16107.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16108.                               └───────────────────────┘
  16109.                                copyright(c) 1992, 1993
  16110.      
  16111.      function:       strlfdelnew (STRing LeFt DELete to NEW string)
  16112.      
  16113.      KWIC:           %delete characters on the %left side of a string
  16114.      
  16115.      syntax:         #include "hhstring.h"
  16116.                      char *strlfdelnew(char *newstring, char *instring,
  16117.                                        int nchar)
  16118.      
  16119.      description:    creates newstring which is identical to instring
  16120.                      except that the leftmost nchar characters of instring
  16121.                      are not included in newstring
  16122.      
  16123.      returns:        a pointer to newstring
  16124.      
  16125.      comments:       The string pointed to by the return value of this function
  16126.                      is in the calling function's space. The return value is
  16127.                      provided as a convenience, not a necessity.
  16128.      
  16129.                      Setting newstring = instring WILL NOT WORK with this
  16130.                      function and overlapping newstring/instring may or may
  16131.                      not work so if you must overlap, do it cautiously.
  16132.      
  16133.      keywords:       string, left, delete, new, truncate
  16134.      
  16135.      key sentence:   creates a new string from a given string by deleting the
  16136.                      leftmost n characters, and returns a pointer to the new
  16137.                      string
  16138.      
  16139.      see also:       str< lf | mid | rt >del{new}
  16140.      
  16141.      usage example:  compiled/executed/verified on 12/13/92
  16142.      
  16143.                      char NEWstring[80];
  16144.                      char instring[80] = "this is the input string";
  16145.                      strlfdelnew(NEWstring, instring, 8);
  16146.                      printf("%s", NEWstring);
  16147.      
  16148.                      the input string
  16149.      
  16150.                               ┌───────────────────────┐
  16151.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16152.                               └───────────────────────┘                      */
  16153.  
  16154.  
  16155.  
  16156.  
  16157.  
  16158.  
  16159.  
  16160.      page 258            The Hobbit House String Library
  16161.  
  16162.  
  16163.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16164.      ║ LEFTJUS.C    ║   file date: 03/13/93    page   1 of   1 ║ LEFTJUS.C    ║
  16165.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16166.  
  16167.      /*                       ┌───────────────────────┐               strlfjust
  16168.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16169.                               └───────────────────────┘
  16170.                                copyright(c) 1992, 1993
  16171.      
  16172.      function:       strlfjust (STRing LeFt JUSTify)
  16173.      
  16174.      KWIC:           %left %justify a string
  16175.      
  16176.      syntax:         #include "hhstring.h"
  16177.                      char *strlfjust(char *instring)
  16178.      
  16179.      description:    the contents of instring are shifted left to remove any
  16180.                      whitespace (blanks or TABs) on the left side. Blanks are
  16181.                      shifted in on the right to replace the characters shifted
  16182.                      out to the left.
  16183.      
  16184.      returns:        a pointer to instring
  16185.      
  16186.      comments:       note that only one blank is shifted in on the right to
  16187.                      replace a TAB that is deleted from the left side of the
  16188.                      string.
  16189.      
  16190.                      The string pointed to by the return value of this function
  16191.                      is in the calling function's space. The return value is
  16192.                      provided as a convenience, not a necessity.
  16193.      
  16194.      keywords:       string, left, justify
  16195.      
  16196.      key sentence:   moves any leading blanks in a string to the right side
  16197.                      (note that TABs are not well handled), and returns a
  16198.                      pointer to the string
  16199.      
  16200.      see also:       str< lf | rt >just{new}         strcenter{n}{new}
  16201.      
  16202.      usage example:  compiled/executed/verified on 12/13/92
  16203.      
  16204.                      char *Astring = "   Left Justify this string";
  16205.                      strlfjust(Astring);
  16206.                      printf("-->%s<--", Astring);
  16207.      
  16208.                      -->Left Justify this string   <--
  16209.      
  16210.                               ┌───────────────────────┐
  16211.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16212.                               └───────────────────────┘                      */
  16213.  
  16214.  
  16215.  
  16216.  
  16217.  
  16218.  
  16219.  
  16220.  
  16221.                          The Hobbit House String Library               page 259
  16222.  
  16223.  
  16224.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16225.      ║ LEFTJUSW.C   ║   file date: 03/13/93    page   1 of   2 ║ LEFTJUSW.C   ║
  16226.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16227.  
  16228.      /*                       ┌───────────────────────┐            strlfjustnew
  16229.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16230.                               └───────────────────────┘
  16231.                                copyright(c) 1992, 1993
  16232.      
  16233.      function:       strlfjustnew (STRing LeFt JUStify to NEW string)
  16234.      
  16235.      KWIC:           %left %justify a string
  16236.      
  16237.      syntax:         #include "hhstring.h"
  16238.                      char *strlfjustnew(char *newstring, char *instring)
  16239.      
  16240.      description:    the contents of instring are shifted left to remove any
  16241.                      whitespace (blanks or TABs) on the left side. Blanks are
  16242.                      shifted in on the right to replace the characters shifted
  16243.                      out to the left. The results go to the newstring. instring
  16244.                      is not changed.
  16245.      
  16246.      returns:        a pointer to newstring
  16247.      
  16248.      comments:       note that only one blank is shifted in on the right for
  16249.                      each TAB that is deleted from the left side of the string.
  16250.      
  16251.                      The string pointed to by the return value of this function
  16252.                      is in the calling function's space. The return value is
  16253.                      provided as a convenience, not a necessity.
  16254.      
  16255.                      Setting newstring = instring will work OK with this
  16256.                      function but overlapping newstring/instring may or may not
  16257.                      work so if you must overlap, do it cautiously.
  16258.      
  16259.      keywords:       string, left, justify, new
  16260.      
  16261.      key sentence:   creates a string which is the same as a given string
  16262.                      except that any leading blanks are moved to the right side
  16263.                      of the string (note that TABs are not well handled), and
  16264.                      returns a pointer to the new string
  16265.      
  16266.      see also:       str< lf | rt >just{new}         strcenter{n}{new}
  16267.      
  16268.  
  16269.  
  16270.  
  16271.  
  16272.  
  16273.  
  16274.  
  16275.  
  16276.  
  16277.  
  16278.  
  16279.  
  16280.  
  16281.  
  16282.      page 260            The Hobbit House String Library
  16283.  
  16284.  
  16285.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16286.      ║ LEFTJUSW.C   ║   file date: 03/13/93    page   2 of   2 ║ LEFTJUSW.C   ║
  16287.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16288.  
  16289.      
  16290.      
  16291.      usage example:  compiled/executed/verified on 12/13/92
  16292.      
  16293.                      char Astring[80]= "   Left Justify this string";
  16294.                      char Bstring[80];
  16295.                      strlfjustnew(Bstring, Astring);
  16296.                      printf("-->%s<--", Bstring);
  16297.      
  16298.                      -->Left Justify this string   <--
  16299.      
  16300.                               ┌───────────────────────┐
  16301.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16302.                               └───────────────────────┘                      */
  16303.  
  16304.  
  16305.  
  16306.  
  16307.  
  16308.  
  16309.  
  16310.  
  16311.  
  16312.  
  16313.  
  16314.  
  16315.  
  16316.  
  16317.  
  16318.  
  16319.  
  16320.  
  16321.  
  16322.  
  16323.  
  16324.  
  16325.  
  16326.  
  16327.  
  16328.  
  16329.  
  16330.  
  16331.  
  16332.  
  16333.  
  16334.  
  16335.  
  16336.  
  16337.  
  16338.  
  16339.  
  16340.  
  16341.  
  16342.  
  16343.                          The Hobbit House String Library               page 261
  16344.  
  16345.  
  16346.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16347.      ║ LEFTPAD.C    ║   file date: 03/13/93    page   1 of   1 ║ LEFTPAD.C    ║
  16348.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16349.  
  16350.      /*                       ┌───────────────────────┐                strlfpad
  16351.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16352.                               └───────────────────────┘
  16353.                                copyright(c) 1992, 1993
  16354.      
  16355.      function:       strlfpad (STRing LeFt PAD)
  16356.      
  16357.      KWIC:           %pad a string on the %left
  16358.      
  16359.      syntax:         #include "hhstring.h"
  16360.                      char *strlfpad(char *instring, int nchars, char PadChar)
  16361.      
  16362.      description:    instring is moved to a new memory location nchars
  16363.                      beyond the one it used to occupy and then the first
  16364.                      nchars locations are filled with PadChar.
  16365.      
  16366.      returns:        a pointer to instring
  16367.      
  16368.      comments:       the input string MUST have enough memory space to allow an
  16369.                      increase in size to accommodate the inserted blanks. This
  16370.                      function cannot verify that, so must assume it. If it
  16371.                      isn't true, this function will destroy whatever is in the
  16372.                      memory space following the input string. WATCH OUT !!!
  16373.      
  16374.                      The string pointed to by the return value of this function
  16375.                      is in the calling function's space. The return value is
  16376.                      provided as a convenience, not a necessity.
  16377.      
  16378.      keywords:       string, left, pad, size
  16379.      
  16380.      key sentence:   changes the size of a string by padding it on the left
  16381.                                                                            with
  16382.                      n occurrences of the character c, and returns a pointer to
  16383.                      the modified string
  16384.      
  16385.      see also:       str< lf | mid | rt >pad{new}
  16386.      
  16387.      usage example:  compiled/executed/verified on 12/13/92
  16388.      
  16389.                      char Astring[80];
  16390.                      strcpy(Astring, "put this in Astring");
  16391.                      strlfpad(Astring, 5, ' ');
  16392.                      strlfpad(Astring, 5, 'x');
  16393.                      printf("%s", Astring);
  16394.      
  16395.                      xxxxx     put this in Astring
  16396.      
  16397.                               ┌───────────────────────┐
  16398.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16399.                               └───────────────────────┘                      */
  16400.  
  16401.  
  16402.  
  16403.  
  16404.      page 262            The Hobbit House String Library
  16405.  
  16406.  
  16407.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16408.      ║ LEFTPADW.C   ║   file date: 03/13/93    page   1 of   1 ║ LEFTPADW.C   ║
  16409.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16410.  
  16411.      /*                       ┌───────────────────────┐             strlfpadnew
  16412.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16413.                               └───────────────────────┘
  16414.                                copyright(c) 1992, 1993
  16415.      
  16416.      function:       strlfpadnew (STRing LeFt PAD to NEW string)
  16417.      
  16418.      KWIC:           %pad a string on the %left
  16419.      
  16420.      syntax:         #include "hhstring.h"
  16421.                      char *strlfpadnew(char *newstring, char *instring,
  16422.                                        int nchars, char PadChar)
  16423.      
  16424.      description:    create newstring, consisting of nchars occurrences of
  16425.                      PadChar, followed by instring
  16426.      
  16427.      returns:        a pointer to newstring.
  16428.      
  16429.      comments:       The string pointed to by the return value of this function
  16430.                      is in the calling function's space. The return value is
  16431.                      provided as a convenience, not a necessity.
  16432.      
  16433.                      Setting newstring = instring WILL NOT WORK with this
  16434.                      function and overlapping newstring/instring will not work
  16435.                      in general although it will may work in some special
  16436.                      cases. Analyse the source code if you need more details.
  16437.      
  16438.      keywords:       string, left, pad, new, size
  16439.      
  16440.      key sentence:   creates a new string which has a specified number of a
  16441.                      specified pad character, on the left, followed by a given
  16442.                      string, and returns a pointer to the new string
  16443.      
  16444.      see also:       str< lf | mid | rt >pad{new}
  16445.      
  16446.      usage example:  compiled/executed/verified on 12/13/92
  16447.      
  16448.                      char *Astring = "this is Astring";
  16449.                      char Bstring[80];
  16450.                      strlfpadnew(Bstring, Astring, 5, 'x');
  16451.                      printf("%s", Bstring);
  16452.      
  16453.                      xxxxxthis is Astring
  16454.      
  16455.                               ┌───────────────────────┐
  16456.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16457.                               └───────────────────────┘                      */
  16458.  
  16459.  
  16460.  
  16461.  
  16462.  
  16463.  
  16464.  
  16465.                          The Hobbit House String Library               page 263
  16466.  
  16467.  
  16468.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16469.      ║ LEFTROT.C    ║   file date: 03/13/93    page   1 of   1 ║ LEFTROT.C    ║
  16470.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16471.  
  16472.      /*                       ┌───────────────────────┐                strlfrot
  16473.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16474.                               └───────────────────────┘
  16475.                                copyright(c) 1992, 1993
  16476.      
  16477.      function:       strlfrot (STRing LeFt ROTate)
  16478.      
  16479.      KWIC:           %rotate a string to the %left
  16480.      
  16481.      syntax:         #include <alloc.h>      (malloc.h for Microsoft)
  16482.                      #include "hhstring.h"
  16483.                      char *strlfrot(char *instring, int nchar)
  16484.      
  16485.      description:    rotates instring left nchar places.
  16486.      
  16487.      returns:        a pointer to instring
  16488.      
  16489.      comments:       if nchar is greater than the length of the string, then
  16490.                      it is taken MODULO the string length prior to the rotate,
  16491.                      so that long rotates are handled properly
  16492.      
  16493.                      The string pointed to by the return value of this function
  16494.                      is in the calling function's space. The return value is
  16495.                      provided as a convenience, not a necessity.
  16496.      
  16497.      keywords:       string, left, rotate
  16498.      
  16499.      key sentence:   rotates a string, left, n places, and returns a pointer to
  16500.                      the string
  16501.      
  16502.      see also:       str< lf | rt >sh{new}           str< lf | rt >rot{new}
  16503.      
  16504.      usage example:  compiled/executed/verified on 12/13/92
  16505.      
  16506.                      char *Astring = "---This is the string to rotate";
  16507.                      strlfrot(Astring, 3);
  16508.                      printf("%s", Astring);
  16509.      
  16510.                      This is the string to rotate---
  16511.      
  16512.                               ┌───────────────────────┐
  16513.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16514.                               └───────────────────────┘                      */
  16515.  
  16516.  
  16517.  
  16518.  
  16519.  
  16520.  
  16521.  
  16522.  
  16523.  
  16524.  
  16525.  
  16526.      page 264            The Hobbit House String Library
  16527.  
  16528.  
  16529.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16530.      ║ LEFTROTW.C   ║   file date: 03/13/93    page   1 of   1 ║ LEFTROTW.C   ║
  16531.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16532.  
  16533.      /*                       ┌───────────────────────┐             strlfrotnew
  16534.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16535.                               └───────────────────────┘
  16536.                                copyright(c) 1992, 1993
  16537.      
  16538.      function:       strlfrotnew (STRing LeFt ROTate to NEW string)
  16539.      
  16540.      KWIC:           %rotate a string to the %left
  16541.      
  16542.      syntax:         #include "hhstring.h"
  16543.                      char *strlfrotnew(char *newstring, char *instring,
  16544.                                        int nchar)
  16545.      
  16546.      description:    creates newstring as a left rotate, by nchar places, of
  16547.                      instring
  16548.      
  16549.      returns:        a pointer to newstring
  16550.      
  16551.      comments:       If nchar is bigger than the length of the string, it will
  16552.                      be taken MODULO the length of the string before the rotate
  16553.                      is performed, so that long rotates are performed correctly
  16554.      
  16555.                      The string pointed to by the return value of this function
  16556.                      is in the calling function's space. The return value is
  16557.                      provided as a convenience, not a necessity.
  16558.      
  16559.                      Setting newstring = instring WILL NOT WORK with this
  16560.                      function and overlapping newstring/instring may or may
  16561.                      not work so if you must overlap, do it cautiously.
  16562.      
  16563.      keywords:       string, left, rotate, new
  16564.      
  16565.      key sentence:   creates a new string as a left rotate, n places, of a
  16566.                      given string, and returns a pointer to the new string
  16567.      
  16568.      see also:       str< lf | rt >sh{new}           str< lf | rt >rot{new}
  16569.      
  16570.      usage example:  compiled/executed/verified on 12/13/92
  16571.      
  16572.                      char *Astring = "---This is the string to rotate";
  16573.                      char Bstring[80];
  16574.                      strlfrotnew(Bstring, Astring, 3);
  16575.                      printf("%s", Bstring);
  16576.      
  16577.                      This is the string to rotate---
  16578.      
  16579.                               ┌───────────────────────┐
  16580.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16581.                               └───────────────────────┘                      */
  16582.  
  16583.  
  16584.  
  16585.  
  16586.  
  16587.                          The Hobbit House String Library               page 265
  16588.  
  16589.  
  16590.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16591.      ║ LEFTSET.C    ║   file date: 03/13/93    page   1 of   1 ║ LEFTSET.C    ║
  16592.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16593.  
  16594.      /*                       ┌───────────────────────┐                strlfset
  16595.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16596.                               └───────────────────────┘
  16597.                                copyright(c) 1992, 1993
  16598.      
  16599.      function:       strlfset (STRing LeFt SET)
  16600.      
  16601.      KWIC:           %set the %left side of a string
  16602.      
  16603.      syntax:         #include "hhstring.h"
  16604.                      char *strlfset(char *instring, int nchar, char setchar)
  16605.      
  16606.      description:    sets the leftmost nchar characters of instring to setchar
  16607.      
  16608.      returns:        a pointer to instring
  16609.      
  16610.      comments:       if nchar is longer than the string, overflow will NOT be
  16611.                      allowed but the entire string will be set to setchar
  16612.      
  16613.                      The string pointed to by the return value of this function
  16614.                      is in the calling function's space. The return value is
  16615.                      provided as a convenience, not a necessity.
  16616.      
  16617.      keywords:       string, left, set
  16618.      
  16619.      key sentence:   sets the leftmost n characters of a string to the
  16620.                      character c, and returns a pointer to the string
  16621.      
  16622.      see also:       str{ lf | mid | rt }set{new}
  16623.      
  16624.      usage example:  compiled/executed/verified on 2/4/93
  16625.      
  16626.                      char *Astring = "This is the string";
  16627.                      strlfset(Astring, 4, 'x');
  16628.                      printf("%s", Astring);
  16629.      
  16630.                      xxxx is the string
  16631.      
  16632.                               ┌───────────────────────┐
  16633.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16634.                               └───────────────────────┘                      */
  16635.  
  16636.  
  16637.  
  16638.  
  16639.  
  16640.  
  16641.  
  16642.  
  16643.  
  16644.  
  16645.  
  16646.  
  16647.  
  16648.      page 266            The Hobbit House String Library
  16649.  
  16650.  
  16651.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16652.      ║ LEFTSETW.C   ║   file date: 03/13/93    page   1 of   2 ║ LEFTSETW.C   ║
  16653.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16654.  
  16655.      /*                       ┌───────────────────────┐             strlfsetnew
  16656.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16657.                               └───────────────────────┘
  16658.                                copyright(c) 1992, 1993
  16659.      
  16660.      function:       strlfsetnew (STRing LeFt SET to NEW string)
  16661.      
  16662.      KWIC:           %set the %left side of a string
  16663.      
  16664.      syntax:         #include "hhstring.h"
  16665.                      char *strlfsetnew(char *newstring, char *instring,
  16666.                                         int nchar, char setchar)
  16667.      
  16668.      description:    creates a new string which is instring but with the
  16669.                      leftmost nchar characters set to setchar
  16670.      
  16671.      returns:        a pointer to newstring
  16672.      
  16673.      comments:       if nchar is longer than instring, then newstring will be
  16674.                      the same length as instring, but will be completely set to
  16675.                      setchar
  16676.      
  16677.                      The string pointed to by the return value of this function
  16678.                      is in the calling function's space. The return value is
  16679.                      provided as a convenience, not a necessity.
  16680.      
  16681.                      Setting newstring = instring will work OK with this
  16682.                      function but overlapping newstring/instring may or may
  16683.                      not work so if you must overlap, do it cautiously.
  16684.      
  16685.      keywords:       string, left, set, new
  16686.      
  16687.      key sentence:   creates a string which is the same as a given string
  16688.                      except that the leftmost n characters are set to the
  16689.                      character c, and returns a pointer to the new string
  16690.      
  16691.      see also:       str{ lf | mid | rt }set{new}
  16692.      
  16693.  
  16694.  
  16695.  
  16696.  
  16697.  
  16698.  
  16699.  
  16700.  
  16701.  
  16702.  
  16703.  
  16704.  
  16705.  
  16706.  
  16707.  
  16708.  
  16709.                          The Hobbit House String Library               page 267
  16710.  
  16711.  
  16712.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16713.      ║ LEFTSETW.C   ║   file date: 03/13/93    page   2 of   2 ║ LEFTSETW.C   ║
  16714.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16715.  
  16716.      
  16717.      
  16718.      usage example:  compiled/executed/verified on 2/4/93
  16719.      
  16720.                      char Astring[80] = "this is the string to set";
  16721.                      char Bstring[80];
  16722.                      strlfsetnew(Bstring, Astring, 7, '-');
  16723.                      printf("%s", Bstring);
  16724.      
  16725.                      ------- the string to set
  16726.      
  16727.                               ┌───────────────────────┐
  16728.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16729.                               └───────────────────────┘                      */
  16730.  
  16731.  
  16732.  
  16733.  
  16734.  
  16735.  
  16736.  
  16737.  
  16738.  
  16739.  
  16740.  
  16741.  
  16742.  
  16743.  
  16744.  
  16745.  
  16746.  
  16747.  
  16748.  
  16749.  
  16750.  
  16751.  
  16752.  
  16753.  
  16754.  
  16755.  
  16756.  
  16757.  
  16758.  
  16759.  
  16760.  
  16761.  
  16762.  
  16763.  
  16764.  
  16765.  
  16766.  
  16767.  
  16768.  
  16769.  
  16770.      page 268            The Hobbit House String Library
  16771.  
  16772.  
  16773.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16774.      ║ LEFTSHF.C    ║   file date: 03/13/93    page   1 of   1 ║ LEFTSHF.C    ║
  16775.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16776.  
  16777.      /*                       ┌───────────────────────┐                 strlfsh
  16778.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16779.                               └───────────────────────┘
  16780.                                copyright(c) 1992, 1993
  16781.      
  16782.      function:       strlfsh (STRing LeFt SHift)
  16783.      
  16784.      KWIC:           %shift a string to the %left
  16785.      
  16786.      syntax:         #include "hhstring.h"
  16787.                      char *strlfsh (char *instring, int nchar)
  16788.      
  16789.      description:    shift instring left by nchar places and fill with blanks
  16790.                      on the right
  16791.      
  16792.      returns:        a pointer to instring
  16793.      
  16794.      comments:       The string pointed to by the return value of this function
  16795.                      is in the calling function's space. The return value is
  16796.                      provided as a convenience, not a necessity.
  16797.      
  16798.      keywords:       string, left, shift
  16799.      
  16800.      key sentence:   shifts a string n characters to the left, shifting in
  16801.                      blanks on the right, and returns a pointer to the string
  16802.      
  16803.      see also:       str< lf | rt >sh{new}           str< lf | rt >rot{new}
  16804.      
  16805.      usage example:  compiled/executed/verified on 12/13/92
  16806.      
  16807.                      char *string1 = "this is string1";
  16808.                      printf("\n->%s<-", string1);
  16809.                      strlfsh(string1, 5);
  16810.                      printf("\n->%s<-", string1);
  16811.      
  16812.                      ->this is string1<-
  16813.                      ->is string1     <-
  16814.      
  16815.                               ┌───────────────────────┐
  16816.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16817.                               └───────────────────────┘                      */
  16818.  
  16819.  
  16820.  
  16821.  
  16822.  
  16823.  
  16824.  
  16825.  
  16826.  
  16827.  
  16828.  
  16829.  
  16830.  
  16831.                          The Hobbit House String Library               page 269
  16832.  
  16833.  
  16834.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16835.      ║ LEFTSHFW.C   ║   file date: 03/13/93    page   1 of   1 ║ LEFTSHFW.C   ║
  16836.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16837.  
  16838.      /*                       ┌───────────────────────┐              strlfshnew
  16839.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16840.                               └───────────────────────┘
  16841.                                copyright(c) 1992, 1993
  16842.      
  16843.      function:       strlfshnew (STRing LeFt SHift to NEW string)
  16844.      
  16845.      KWIC:           %shift a string to the %left
  16846.      
  16847.      syntax:         #include "hhstring.h"
  16848.                      char *strlfshnew(char *newstring, char *instring,
  16849.                                       int nchar)
  16850.      
  16851.      description:    create newstring as instring shifted to the left by nchar
  16852.                      places and filled with blanks on the right
  16853.      
  16854.      returns:        a pointer to newstring
  16855.      
  16856.      comments:       The string pointed to by the return value of this function
  16857.                      is in the calling function's space. The return value is
  16858.                      provided as a convenience, not a necessity.
  16859.      
  16860.                      Setting newstring = instring will work OK with this
  16861.                      function but overlapping newstring/instring may or may
  16862.                      not work so if you must overlap, do it cautiously.
  16863.      
  16864.      keywords:       string, left, shift, new
  16865.      
  16866.      key sentence:   creates a new string, which is a given string shifted n
  16867.                      characters to the left, with blanks filling in on the
  16868.                      right, and returns a pointer to the new string
  16869.      
  16870.      see also:       str< lf | rt >sh{new}           str< lf | rt >rot{new}
  16871.      
  16872.      usage example:  compiled/executed/verified on 12/13/92
  16873.      
  16874.                      char newstring[80];
  16875.                      char *string1 = "this is string1";
  16876.                      printf("\n->%s<-", string1);
  16877.                      strlfshnew(newstring, string1, 5);
  16878.                      printf("\n->%s<-", newstring);
  16879.      
  16880.                      ->this is string1<-
  16881.                      ->is string1     <-
  16882.      
  16883.                               ┌───────────────────────┐
  16884.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16885.                               └───────────────────────┘                      */
  16886.  
  16887.  
  16888.  
  16889.  
  16890.  
  16891.  
  16892.      page 270            The Hobbit House String Library
  16893.  
  16894.  
  16895.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16896.      ║ LEFTSIZ.C    ║   file date: 03/13/93    page   1 of   1 ║ LEFTSIZ.C    ║
  16897.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16898.  
  16899.      /*                       ┌───────────────────────┐               strlfsize
  16900.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16901.                               └───────────────────────┘
  16902.                                copyright(c) 1992, 1993
  16903.      
  16904.      function:       strlfsize (STRing, pad/truncate on LeFt to force SIZE)
  16905.      
  16906.      KWIC:           force a string to a fixed %size
  16907.      
  16908.      syntax:         #include "hhstring.h"
  16909.                      char *strlfsize(char *instring, int size)
  16910.      
  16911.      description:    force instring to be size characters long by padding it
  16912.                      on the left with blanks or truncating it on the left
  16913.      
  16914.      returns:        a pointer to instring
  16915.      
  16916.      comments:       this function necessarily assumes that the string space
  16917.                      is big enough to hold any string expansion requested. If
  16918.                      this is not the case then memory locations will be wiped
  16919.                      out and the results will be unpredictable.
  16920.      
  16921.                      The string pointed to by the return value of this function
  16922.                      is in the calling function's space. The return value is
  16923.                      provided as a convenience, not a necessity.
  16924.      
  16925.      keywords:       string, left, size, truncate, delete
  16926.      
  16927.      key sentence:   pads a string on the left with blanks, or truncates it on
  16928.                      the left, as necessary to achieve a specified size, and
  16929.                      returns a pointer to the modified string
  16930.      
  16931.      see also:       str< lf | rt >size{new}
  16932.      
  16933.      usage example:  compiled/executed/verified on 12/13/92
  16934.      
  16935.                      char Astring[80] = "This is the first string";
  16936.                      char Bstring[80] = "second string";
  16937.                      strlfsize(Astring, 16);
  16938.                      strlfsize(Bstring, 16);
  16939.                      printf("%s\n%s", Astring, Bstring);
  16940.      
  16941.                      the first string
  16942.                         second string
  16943.      
  16944.                               ┌───────────────────────┐
  16945.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  16946.                               └───────────────────────┘                      */
  16947.  
  16948.  
  16949.  
  16950.  
  16951.  
  16952.  
  16953.                          The Hobbit House String Library               page 271
  16954.  
  16955.  
  16956.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  16957.      ║ LEFTSIZW.C   ║   file date: 03/13/93    page   1 of   2 ║ LEFTSIZW.C   ║
  16958.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  16959.  
  16960.      /*                       ┌───────────────────────┐            strlfsizenew
  16961.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  16962.                               └───────────────────────┘
  16963.                                copyright(c) 1992, 1993
  16964.      
  16965.      function:       strlfsizenew (STRing, pad/truncate on LeFt to force SIZE
  16966.                                    to NEW string)
  16967.      
  16968.      KWIC:           force a string to a fixed %size
  16969.      
  16970.      syntax:         #include "hhstring.h"
  16971.                      char *strlfsizenew(char *newstring, char *instring,
  16972.                                         int size)
  16973.      
  16974.      description:    create newstring which is size characters long and
  16975.                      consists of instring either padded on the left with
  16976.                      blanks or truncated on the left
  16977.      
  16978.      returns:        a pointer to newstring
  16979.      
  16980.      comments:       this function necessarily assumes that the new string
  16981.                      space is big enough to hold any string expansion
  16982.                      requested. If this is not the case then memory locations
  16983.                      will be wiped out and the results will be unpredictable.
  16984.      
  16985.                      The string pointed to by the return value of this function
  16986.                      is in the calling function's space. The return value is
  16987.                      provided as a convenience, not a necessity.
  16988.      
  16989.      keywords:       string, left, size, new, truncate, delete
  16990.      
  16991.      key sentence:   creates a string which consists of a specified string
  16992.                      either padded on the left with blanks, or truncated on the
  16993.                      left, to achieve a specified size, and returns a pointer
  16994.                      to the new string
  16995.      
  16996.      see also:       str< lf | rt >size{new}
  16997.      
  16998.  
  16999.  
  17000.  
  17001.  
  17002.  
  17003.  
  17004.  
  17005.  
  17006.  
  17007.  
  17008.  
  17009.  
  17010.  
  17011.  
  17012.  
  17013.  
  17014.      page 272            The Hobbit House String Library
  17015.  
  17016.  
  17017.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17018.      ║ LEFTSIZW.C   ║   file date: 03/13/93    page   2 of   2 ║ LEFTSIZW.C   ║
  17019.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17020.  
  17021.      
  17022.      
  17023.      usage example:  compiled/executed/verified on 1/19/93
  17024.      
  17025.                      char Astring[80] = "This is the first string";
  17026.                      char Bstring[80] = "second string";
  17027.                      char Cstring[80];
  17028.                      strlfsizenew(Cstring, Astring, 16);
  17029.                      printf("\n%s", Cstring);
  17030.                      printf("\n%s", strlfsizenew(Cstring, Bstring, 16));
  17031.      
  17032.                      the first string
  17033.                         second string
  17034.      
  17035.                               ┌───────────────────────┐
  17036.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  17037.                               └───────────────────────┘                      */
  17038.  
  17039.  
  17040.  
  17041.  
  17042.  
  17043.  
  17044.  
  17045.  
  17046.  
  17047.  
  17048.  
  17049.  
  17050.  
  17051.  
  17052.  
  17053.  
  17054.  
  17055.  
  17056.  
  17057.  
  17058.  
  17059.  
  17060.  
  17061.  
  17062.  
  17063.  
  17064.  
  17065.  
  17066.  
  17067.  
  17068.  
  17069.  
  17070.  
  17071.  
  17072.  
  17073.  
  17074.  
  17075.                          The Hobbit House String Library               page 273
  17076.  
  17077.  
  17078.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17079.      ║ LEFTTRM.C    ║   file date: 03/13/93    page   1 of   1 ║ LEFTTRM.C    ║
  17080.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17081.  
  17082.      /*                       ┌───────────────────────┐               strlftrim
  17083.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  17084.                               └───────────────────────┘
  17085.                                copyright(c) 1992, 1993
  17086.      
  17087.      function:       strlftrim (STRing LeFt TRIM whitespace)
  17088.      
  17089.      KWIC:           %delete leading %whitespace (blanks and tabs) from a
  17090.                      string
  17091.      
  17092.      syntax:         #include "hhstring.h"
  17093.                      char *strlftrim(char *instring)
  17094.      
  17095.      description:    removes blanks and tabs from the left side of instring
  17096.      
  17097.      returns:        a pointer to instring
  17098.      
  17099.      comments:       if the string consists of nothing but whitespace, then it
  17100.                      will end up as a null string
  17101.      
  17102.                      The string pointed to by the return value of this function
  17103.                      is in the calling function's space. The return value is
  17104.                      provided as a convenience, not a necessity.
  17105.      
  17106.      keywords:       string, left, trim, whitespace, blank, tab, truncate,
  17107.                                                                          delete
  17108.      
  17109.      key sentence:   deletes any leading whitespace from a string and returns
  17110.                      a pointer to the string
  17111.      
  17112.      see also:       str{ lf | rt }trim{new}
  17113.      
  17114.      usage example:  compiled/executed/verified on 12/13/92
  17115.      
  17116.                      char Astring[80] = "   This line has 3 leading blanks";
  17117.                      strlftrim(Astring);
  17118.                      printf("\n%s\n", Astring);
  17119.      
  17120.                      This line has 3 leading blanks
  17121.      
  17122.                               ┌───────────────────────┐
  17123.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  17124.                               └───────────────────────┘                      */
  17125.  
  17126.  
  17127.  
  17128.  
  17129.  
  17130.  
  17131.  
  17132.  
  17133.  
  17134.  
  17135.  
  17136.      page 274            The Hobbit House String Library
  17137.  
  17138.  
  17139.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17140.      ║ LEFTTRMW.C   ║   file date: 03/13/93    page   1 of   1 ║ LEFTTRMW.C   ║
  17141.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17142.  
  17143.      /*                       ┌───────────────────────┐            strlftrimnew
  17144.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  17145.                               └───────────────────────┘
  17146.                                copyright(c) 1992, 1993
  17147.      
  17148.      function:       strlftrimnew (STRing LeFt TRIM whitespace to NEW string)
  17149.      
  17150.      KWIC:           %delete leading %whitespace (blanks and tabs) from a
  17151.                      string
  17152.      
  17153.      syntax:         #include "hhstring.h"
  17154.                      char *strlftrimnew(char *newstring, char *instring)
  17155.      
  17156.      description:    trims blanks and tabs from the left side of instring and
  17157.                      puts the results into newstring
  17158.      
  17159.      returns:        a pointer to newstring
  17160.      
  17161.      comments:       if the string consists of nothing but whitespace, then
  17162.                      the new string will be a null string.
  17163.      
  17164.                      The string pointed to by the return value of this function
  17165.                      is in the calling function's space. The return value is
  17166.                      provided as a convenience, not a necessity.
  17167.      
  17168.                      Setting newstring = instring will work OK with this
  17169.                      function but overlapping newstring/instring may or may
  17170.                      not work so if you must overlap, do it cautiously.
  17171.      
  17172.      keywords:       string, left, trim, whitespace, blank, tab, new, truncate,
  17173.                                                                          delete
  17174.      
  17175.      key sentence:   creates a string by copying in a given string, exclusive
  17176.                      of any leading blanks and tabs, and returns a pointer to
  17177.                      the new string
  17178.      
  17179.      see also:       str{ lf | rt }trim{new}
  17180.      
  17181.      usage example:  compiled/executed/verified on 12/13/92
  17182.      
  17183.                      char *Astring = "   This line has 3 leading blanks";
  17184.                      char Bstring[80];
  17185.                      strlftrimnew(Bstring, Astring);
  17186.                      printf("%s", Bstring);
  17187.      
  17188.                      This line has 3 leading blanks
  17189.      
  17190.                               ┌───────────────────────┐
  17191.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  17192.                               └───────────────────────┘                      */
  17193.  
  17194.  
  17195.  
  17196.  
  17197.                          The Hobbit House String Library               page 275
  17198.  
  17199.  
  17200.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17201.      ║ MID.C        ║   file date: 03/13/93    page   1 of   1 ║ MID.C        ║
  17202.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17203.  
  17204.      /*                       ┌───────────────────────┐                  strmid
  17205.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  17206.                               └───────────────────────┘
  17207.                                copyright(c) 1992, 1993
  17208.      
  17209.      function:       strmid (STRing MIDdle)
  17210.      
  17211.      KWIC:           get the %middle characters from a string
  17212.      
  17213.      syntax:         #include "hhstring.h"
  17214.                      char *strmid(char *instring, int start)
  17215.      
  17216.                      NOTE: "start" is ZERO-origin. That is, to start with the
  17217.                            very first element of a string, specify a start of
  17218.                            0, not 1.
  17219.      
  17220.      description:    modify instring so that it becomes only the characters
  17221.                      starting at start
  17222.      
  17223.      returns:        a pointer to the "new" string, which will use the same
  17224.                      memory space as did the original input string. If the
  17225.                      specified "start" is at or beyond the end of the string,
  17226.                      the string is set to a NULL string.
  17227.      
  17228.      comments:       The string pointed to by the return value of this function
  17229.                      is in the calling function's space. The return value is
  17230.                      provided as a convenience, not a necessity.
  17231.      
  17232.      keywords:       string, middle
  17233.      
  17234.      key sentence:   modifies a string so that it becomes only those characters
  17235.                      in the original string from a specified start to the end
  17236.                      of the string
  17237.      
  17238.      see also:       strleft{new}    strmid{new}
  17239.                      strright{new}   strmidn{new}
  17240.      
  17241.      usage example:  compiled/executed/verified on 12/13/92
  17242.      
  17243.                      char *Astring = "name size date other";
  17244.                      strmid(Astring, 15);
  17245.                      printf("%s", Astring);
  17246.      
  17247.                      other
  17248.      
  17249.                               ┌───────────────────────┐
  17250.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  17251.                               └───────────────────────┘                      */
  17252.  
  17253.  
  17254.  
  17255.  
  17256.  
  17257.  
  17258.      page 276            The Hobbit House String Library
  17259.  
  17260.  
  17261.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17262.      ║ MIDDEL.C     ║   file date: 03/13/93    page   1 of   1 ║ MIDDEL.C     ║
  17263.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17264.  
  17265.      /*                       ┌───────────────────────┐               strmiddel
  17266.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  17267.                               └───────────────────────┘
  17268.                                copyright(c) 1992, 1993
  17269.      
  17270.      function:       strmiddel (STRing MIDdle DELete)
  17271.      
  17272.      KWIC:           %delete the %middle of a string
  17273.      
  17274.      syntax:         #include "hhstring.h"
  17275.                      char *strmiddel(char *instring, int start, int nchar)
  17276.      
  17277.      description:    for the specified string, all of the characters from start
  17278.                      to start+nchar are deleted
  17279.      
  17280.      returns:        a pointer to the string
  17281.      
  17282.      comments:       if start is beyond the end of the string, then nothing is
  17283.                      deleted. If start+nchar is greater than the length of the
  17284.                      string, then only those characters from start to the end
  17285.                      of the string are deleted
  17286.      
  17287.                      The string pointed to by the return value of this function
  17288.                      is in the calling function's space. The return value is
  17289.                      provided as a convenience, not a necessity.
  17290.      
  17291.      keywords:       string, middle, delete, truncate
  17292.      
  17293.      key sentence:   deletes a specified number of characters from a string
  17294.                      starting at a specified point in the string
  17295.      
  17296.      see also:       str< lf | mid | rt >del{new}
  17297.      
  17298.      usage example:  compiled/executed/verified on 12/13/92
  17299.      
  17300.                      char *Astring = "this is the sample string";
  17301.                      strmiddel(Astring, 12, 7);
  17302.                      printf("%s", Astring);
  17303.      
  17304.                      this is the string
  17305.      
  17306.                               ┌───────────────────────┐
  17307.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  17308.                               └───────────────────────┘                      */
  17309.  
  17310.  
  17311.  
  17312.  
  17313.  
  17314.  
  17315.  
  17316.  
  17317.  
  17318.  
  17319.                          The Hobbit House String Library               page 277
  17320.  
  17321.  
  17322.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17323.      ║ MIDDELW.C    ║   file date: 03/13/93    page   1 of   2 ║ MIDDELW.C    ║
  17324.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17325.  
  17326.      /*                       ┌───────────────────────┐            strmiddelnew
  17327.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  17328.                               └───────────────────────┘
  17329.                                copyright(c) 1992, 1993
  17330.      
  17331.      function:       strmiddelnew (STRing MIDdle DELete to NEW string)
  17332.      
  17333.      KWIC:           %delete the %middle of a string
  17334.      
  17335.      syntax:         #include "hhstring.h"
  17336.                      char *strmiddelnew(char *newstring, char *instring,
  17337.                                         int start, int nchar)
  17338.      
  17339.      description:    a new string is created which consists on the first string
  17340.                      but without the specified middle set of characters.
  17341.      
  17342.      returns:        a pointer to the new string
  17343.      
  17344.      comments:       if start is beyond the end of the string, then the new
  17345.                      string is the same as the old string (nothing is deleted).
  17346.                      If start+nchar is greater than the length of the string,
  17347.                      then only those characters from start to the end of the
  17348.                      string are deleted from the input string to create the
  17349.                      new string.
  17350.      
  17351.                      The string pointed to by the return value of this function
  17352.                      is in the calling function's space. The return value is
  17353.                      provided as a convenience, not a necessity.
  17354.      
  17355.                      Setting newstring = instring will work OK with this
  17356.                      function but overlapping newstring/instring may or may
  17357.                      not work so if you must overlap, do it cautiously.
  17358.      
  17359.      keywords:       string, middle, delete, new, truncate
  17360.      
  17361.      key sentence:   deletes a specified number of characters from a string
  17362.                      starting at a specified point in the string and puts the
  17363.                      result into a new string
  17364.      
  17365.      see also:       str< lf | mid | rt >del{new}
  17366.      
  17367.  
  17368.  
  17369.  
  17370.  
  17371.  
  17372.  
  17373.  
  17374.  
  17375.  
  17376.  
  17377.  
  17378.  
  17379.  
  17380.      page 278            The Hobbit House String Library
  17381.  
  17382.  
  17383.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17384.      ║ MIDDELW.C    ║   file date: 03/13/93    page   2 of   2 ║ MIDDELW.C    ║
  17385.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17386.  
  17387.      
  17388.      
  17389.      usage example:  compiled/executed/verified on 12/13/92
  17390.      
  17391.                      char *Astring = "this is the SAMPLE string";
  17392.                      char Bstring[80];
  17393.                      strmiddelnew(Bstring, Astring, 12, 7);
  17394.                      printf("%s", Bstring);
  17395.      
  17396.                      this is the string
  17397.      
  17398.                               ┌───────────────────────┐
  17399.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  17400.                               └───────────────────────┘                      */
  17401.  
  17402.  
  17403.  
  17404.  
  17405.  
  17406.  
  17407.  
  17408.  
  17409.  
  17410.  
  17411.  
  17412.  
  17413.  
  17414.  
  17415.  
  17416.  
  17417.  
  17418.  
  17419.  
  17420.  
  17421.  
  17422.  
  17423.  
  17424.  
  17425.  
  17426.  
  17427.  
  17428.  
  17429.  
  17430.  
  17431.  
  17432.  
  17433.  
  17434.  
  17435.  
  17436.  
  17437.  
  17438.  
  17439.  
  17440.  
  17441.                          The Hobbit House String Library               page 279
  17442.  
  17443.  
  17444.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17445.      ║ MIDN.C       ║   file date: 03/13/93    page   1 of   2 ║ MIDN.C       ║
  17446.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17447.  
  17448.      /*                       ┌───────────────────────┐                 strmidn
  17449.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  17450.                               └───────────────────────┘
  17451.                                copyright(c) 1992, 1993
  17452.      
  17453.      function:       strmidn (STRing, get MIDdle N characters)
  17454.      
  17455.      KWIC:           get the %middle n characters of a string
  17456.      
  17457.      syntax:         #include "hhstring.h"
  17458.                      char *strmidn(char *instring, int start, int nchars)
  17459.      
  17460.                      NOTE: "start" is ZERO-origin. That is, to start with the
  17461.                            10th element of a string, specify a start of 9,
  17462.                            not 10.
  17463.      
  17464.      description:    modify instring so that it becomes only the nchars
  17465.                      characters starting at start
  17466.      
  17467.      returns:        a pointer to the "new" string, which will use the same
  17468.                      memory space as did the original input string. If the
  17469.                      specified "start" is at or beyond the end of the string,
  17470.                      the string is set to a NULL string. If the combination of
  17471.                      "start" + "nchar" would go beyond the end of the string
  17472.                      then overflow is not allowed; only the string up to the
  17473.                      end is included in final string.
  17474.      
  17475.      comments:       The string pointed to by the return value of this function
  17476.                      is in the calling function's space. The return value is
  17477.                      provided as a convenience, not a necessity.
  17478.      
  17479.      keywords:       string, middle
  17480.      
  17481.      key sentence:   modifies a string so that it becomes only the n characters
  17482.                      starting at a specified start in the original string
  17483.      
  17484.      see also:       strleft{new}    strmid{new}
  17485.                      strright{new}   strmidn{new}
  17486.      
  17487.  
  17488.  
  17489.  
  17490.  
  17491.  
  17492.  
  17493.  
  17494.  
  17495.  
  17496.  
  17497.  
  17498.  
  17499.  
  17500.  
  17501.  
  17502.      page 280            The Hobbit House String Library
  17503.  
  17504.  
  17505.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17506.      ║ MIDN.C       ║   file date: 03/13/93    page   2 of   2 ║ MIDN.C       ║
  17507.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17508.  
  17509.      
  17510.      
  17511.      usage example:  compiled/executed/verified on 12/13/92
  17512.      
  17513.                      char *Astring = "name size date other";
  17514.                      strmidn(Astring, 10, 4);
  17515.                      printf("%s", Astring);
  17516.      
  17517.                      date
  17518.      
  17519.                               ┌───────────────────────┐
  17520.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  17521.                               └───────────────────────┘                      */
  17522.  
  17523.  
  17524.  
  17525.  
  17526.  
  17527.  
  17528.  
  17529.  
  17530.  
  17531.  
  17532.  
  17533.  
  17534.  
  17535.  
  17536.  
  17537.  
  17538.  
  17539.  
  17540.  
  17541.  
  17542.  
  17543.  
  17544.  
  17545.  
  17546.  
  17547.  
  17548.  
  17549.  
  17550.  
  17551.  
  17552.  
  17553.  
  17554.  
  17555.  
  17556.  
  17557.  
  17558.  
  17559.  
  17560.  
  17561.  
  17562.  
  17563.                          The Hobbit House String Library               page 281
  17564.  
  17565.  
  17566.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17567.      ║ MIDW.C       ║   file date: 03/13/93    page   1 of   2 ║ MIDW.C       ║
  17568.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17569.  
  17570.      /*                       ┌───────────────────────┐               strmidnew
  17571.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  17572.                               └───────────────────────┘
  17573.                                copyright(c) 1992, 1993
  17574.      
  17575.      function:       strmidnew (STRing MIDdle to NEW string)
  17576.      
  17577.      KWIC:           get the %middle of a string
  17578.      
  17579.      syntax:         #include "hhstring.h"
  17580.                      char *strmidnew(char *newstring, char *instring,
  17581.                                      int start)
  17582.      
  17583.                      NOTE: "start" is ZERO-origin. That is, to start with the
  17584.                            very first element of a string, specify a start of
  17585.                            0, not 1.
  17586.      
  17587.      description:    create a new string which is the input string starting at
  17588.                      "start" characters from the beginning.
  17589.      
  17590.      returns:        a pointer to the "new" string. If "start" goes beyond the
  17591.                      end of the string, then the new string is set to a NULL.
  17592.      
  17593.      comments:       The string pointed to by the return value of this function
  17594.                      is in the calling function's space. The return value is
  17595.                      provided as a convenience, not a necessity.
  17596.      
  17597.                      Setting newstring = instring will work OK with this
  17598.                      function but overlapping newstring/instring may or may not
  17599.                      work so if you must overlap, do it cautiously.
  17600.      
  17601.      keywords:       string, middle, new
  17602.      
  17603.      key sentence:   copies a string, starting at a specified point, to a new
  17604.                      string
  17605.      
  17606.      see also:       strleft{new}    strmid{new}
  17607.                      strright{new}   strmidn{new}
  17608.      
  17609.  
  17610.  
  17611.  
  17612.  
  17613.  
  17614.  
  17615.  
  17616.  
  17617.  
  17618.  
  17619.  
  17620.  
  17621.  
  17622.  
  17623.  
  17624.      page 282            The Hobbit House String Library
  17625.  
  17626.  
  17627.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17628.      ║ MIDW.C       ║   file date: 03/13/93    page   2 of   2 ║ MIDW.C       ║
  17629.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17630.  
  17631.      
  17632.      
  17633.      usage example:  compiled/executed/verified on 12/13/92
  17634.      
  17635.                      char Astring[80] = "name size date other";
  17636.                      char Bstring[80] = "name size date several others";
  17637.                      char Newstring[80];
  17638.                      strmidnew(Newstring, Astring, 15);
  17639.                      printf("\n%s", Newstring);
  17640.                      strmidnew(Newstring, Bstring, 15);
  17641.                      printf("\n%s", Newstring);
  17642.      
  17643.                      other
  17644.                      several others
  17645.      
  17646.                               ┌───────────────────────┐
  17647.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  17648.                               └───────────────────────┘                      */
  17649.  
  17650.  
  17651.  
  17652.  
  17653.  
  17654.  
  17655.  
  17656.  
  17657.  
  17658.  
  17659.  
  17660.  
  17661.  
  17662.  
  17663.  
  17664.  
  17665.  
  17666.  
  17667.  
  17668.  
  17669.  
  17670.  
  17671.  
  17672.  
  17673.  
  17674.  
  17675.  
  17676.  
  17677.  
  17678.  
  17679.  
  17680.  
  17681.  
  17682.  
  17683.  
  17684.  
  17685.                          The Hobbit House String Library               page 283
  17686.  
  17687.  
  17688.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17689.      ║ MIDNW.C      ║   file date: 03/13/93    page   1 of   2 ║ MIDNW.C      ║
  17690.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17691.  
  17692.      /*                       ┌───────────────────────┐              strmidnnew
  17693.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  17694.                               └───────────────────────┘
  17695.                                copyright(c) 1992, 1993
  17696.      
  17697.      function:       strmidnnew (STRing, get MIDdle N characters, to NEW)
  17698.      
  17699.      KWIC:           get the %middle n characters of a string
  17700.      
  17701.      syntax:         #include "hhstring.h"
  17702.                      char *strmidnnew(char *newstring, char *instring,
  17703.                                       int start, int nchars)
  17704.      
  17705.                      NOTE: "start" is ZERO-origin. That is, to start with the
  17706.                            10th element of a string, specify a start of 9,
  17707.                            not 10.
  17708.      
  17709.      description:    Create a new string which consists of the characters from
  17710.                      an old string, starting at "start" and ending at "start" +
  17711.                      "nchars".
  17712.      
  17713.      returns:        a pointer to the new string. If the specified "start" is
  17714.                      at or beyond the end of the string, "newstring" is set to
  17715.                      a NULL. If the combination of "start" + "nchar" would go
  17716.                      beyond the end of the input string, then overflow is not
  17717.                      allowed; only the string up to the end is included in the
  17718.                      new string.
  17719.      
  17720.      comments:       The string pointed to by the return value of this function
  17721.                      is in the calling function's space. The return value is
  17722.                      provided as a convenience, not a necessity.
  17723.      
  17724.                      Setting newstring = instring will work OK with this
  17725.                      function but overlapping newstring/instring may or may
  17726.                      not work so if you must overlap, do it cautiously.
  17727.      
  17728.      keywords:       string, middle, new
  17729.      
  17730.      key sentence:   creates a new string which is a specified number of
  17731.                      characters of a first string, starting at a specified
  17732.                      point in the first string
  17733.      
  17734.      see also:       strleft{new}    strmid{new}
  17735.                      strright{new}   strmidn{new}
  17736.      
  17737.  
  17738.  
  17739.  
  17740.  
  17741.  
  17742.  
  17743.  
  17744.  
  17745.  
  17746.      page 284            The Hobbit House String Library
  17747.  
  17748.  
  17749.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17750.      ║ MIDNW.C      ║   file date: 03/13/93    page   2 of   2 ║ MIDNW.C      ║
  17751.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17752.  
  17753.      
  17754.      
  17755.      usage example:  compiled/executed/verified on 12/13/92
  17756.      
  17757.                      char *Astring = "name size date other";
  17758.                      char Newstring[80];
  17759.                      strmidnnew (Newstring, Astring,5,4);
  17760.                      printf("%s", Newstring);
  17761.      
  17762.                      size
  17763.      
  17764.                               ┌───────────────────────┐
  17765.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  17766.                               └───────────────────────┘                      */
  17767.  
  17768.  
  17769.  
  17770.  
  17771.  
  17772.  
  17773.  
  17774.  
  17775.  
  17776.  
  17777.  
  17778.  
  17779.  
  17780.  
  17781.  
  17782.  
  17783.  
  17784.  
  17785.  
  17786.  
  17787.  
  17788.  
  17789.  
  17790.  
  17791.  
  17792.  
  17793.  
  17794.  
  17795.  
  17796.  
  17797.  
  17798.  
  17799.  
  17800.  
  17801.  
  17802.  
  17803.  
  17804.  
  17805.  
  17806.  
  17807.                          The Hobbit House String Library               page 285
  17808.  
  17809.  
  17810.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17811.      ║ MIDPAD.C     ║   file date: 03/13/93    page   1 of   2 ║ MIDPAD.C     ║
  17812.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17813.  
  17814.      /*                       ┌───────────────────────┐               strmidpad
  17815.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  17816.                               └───────────────────────┘
  17817.                                copyright(c) 1992, 1993
  17818.      
  17819.      function:       strmidpad (STRing MIDdle PAD)
  17820.      
  17821.      KWIC:           %pad a string in the %middle
  17822.      
  17823.      syntax:         #include "hhstring.h"
  17824.                      char *strmidpad(char *instring, int where, int nchar,
  17825.                                      char padchar)
  17826.      
  17827.      description:    instring is opened at where and nchar padchars are
  17828.                      inserted.
  17829.      
  17830.      WARNING:        the input string MUST have enough memory space beyond its
  17831.                      terminating 0 to accommodate the extra characters. This
  17832.                      function necessarily assumes that the space is available.
  17833.                      If the space is not available, this function will destroy
  17834.                      whatever is in the memory space following the input
  17835.                      string.
  17836.      
  17837.      returns:        a pointer to the string
  17838.      
  17839.      comments:       The input string MUST have enough extra memory space to
  17840.                      allow for the insertion of the new characters, else
  17841.                      subsequent memory will be destroyed.
  17842.      
  17843.                      The string pointed to by the return value of this function
  17844.                      is in the calling function's space. The return value is
  17845.                      provided as a convenience, not a necessity.
  17846.      
  17847.      keywords:       string, middle, pad, size
  17848.      
  17849.      key sentence:   changes the size of a string by opening it up at a
  17850.                                                                       specified
  17851.                      point and inserting n copies of the character c into it,
  17852.                                                                             and
  17853.                      returns a pointer to the modifited string
  17854.      
  17855.      see also:       str< lf | mid | rt >pad{new}
  17856.      
  17857.  
  17858.  
  17859.  
  17860.  
  17861.  
  17862.  
  17863.  
  17864.  
  17865.  
  17866.  
  17867.  
  17868.      page 286            The Hobbit House String Library
  17869.  
  17870.  
  17871.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17872.      ║ MIDPAD.C     ║   file date: 03/13/93    page   2 of   2 ║ MIDPAD.C     ║
  17873.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17874.  
  17875.      
  17876.      
  17877.      usage example:  compiled/executed/verified on 12/13/92
  17878.      
  17879.                      char Astring[80] = "This is it; the sample";
  17880.                      strmidpad(Astring, 12, 3, '-');
  17881.                      printf("%s", Astring);
  17882.      
  17883.                      This is it; ---the sample
  17884.      
  17885.                               ┌───────────────────────┐
  17886.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  17887.                               └───────────────────────┘                      */
  17888.  
  17889.  
  17890.  
  17891.  
  17892.  
  17893.  
  17894.  
  17895.  
  17896.  
  17897.  
  17898.  
  17899.  
  17900.  
  17901.  
  17902.  
  17903.  
  17904.  
  17905.  
  17906.  
  17907.  
  17908.  
  17909.  
  17910.  
  17911.  
  17912.  
  17913.  
  17914.  
  17915.  
  17916.  
  17917.  
  17918.  
  17919.  
  17920.  
  17921.  
  17922.  
  17923.  
  17924.  
  17925.  
  17926.  
  17927.  
  17928.  
  17929.                          The Hobbit House String Library               page 287
  17930.  
  17931.  
  17932.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17933.      ║ MIDPADW.C    ║   file date: 03/13/93    page   1 of   2 ║ MIDPADW.C    ║
  17934.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17935.  
  17936.      /*                       ┌───────────────────────┐            strmidpadnew
  17937.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  17938.                               └───────────────────────┘
  17939.                                copyright(c) 1992, 1993
  17940.      
  17941.      function:       strmidpadnew (STRing MIDdle PAD to NEW string)
  17942.      
  17943.      KWIC:           %pad a string in the %middle
  17944.      
  17945.      syntax:         #include "hhstring.h"
  17946.                      char *strmidpadnew(char *newstring, char *instring,
  17947.                                         int where, int nchar, char padchar)
  17948.      
  17949.      description:    "instring"is opened up at "where" and "nchar" "padchar"s
  17950.                      are inserted, with the result going to "newstring"
  17951.      
  17952.      returns:        a pointer to the new string
  17953.      
  17954.      comments:       The new string MUST have enough memory space to allow for
  17955.                      instring plus the inserted characters, else subsequent
  17956.                      memory will be destroyed.
  17957.      
  17958.                      The string pointed to by the return value of this function
  17959.                      is in the calling function's space. The return value is
  17960.                      provided as a convenience, not a necessity.
  17961.      
  17962.                      Setting newstring = instring WILL NOT WORK with this
  17963.                      function and overlapping newstring/instring may or may
  17964.                      not work so if you must overlap, do it cautiously.
  17965.      
  17966.      keywords:       string, middle, pad, new, size
  17967.      
  17968.      key sentence:   copies a given string into a new string and inserts n
  17969.                                                                          copies
  17970.                      of the character c at a specified location in the new
  17971.                                                                          string
  17972.                      and returns a pointer to the new string
  17973.      
  17974.      see also:       str< lf | mid | rt >pad{new}
  17975.      
  17976.  
  17977.  
  17978.  
  17979.  
  17980.  
  17981.  
  17982.  
  17983.  
  17984.  
  17985.  
  17986.  
  17987.  
  17988.  
  17989.  
  17990.      page 288            The Hobbit House String Library
  17991.  
  17992.  
  17993.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  17994.      ║ MIDPADW.C    ║   file date: 03/13/93    page   2 of   2 ║ MIDPADW.C    ║
  17995.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  17996.  
  17997.      
  17998.      
  17999.      usage example:  compiled/executed/verified on 12/13/92
  18000.      
  18001.                      char Astring[80] = "This is it; the sample";
  18002.                      char Bstring[80];
  18003.                      strmidpadnew(Bstring, Astring, 12, 3, '-');
  18004.                      printf("%s", Bstring);
  18005.      
  18006.                      This is it; ---the sample
  18007.      
  18008.                               ┌───────────────────────┐
  18009.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  18010.                               └───────────────────────┘                      */
  18011.  
  18012.  
  18013.  
  18014.  
  18015.  
  18016.  
  18017.  
  18018.  
  18019.  
  18020.  
  18021.  
  18022.  
  18023.  
  18024.  
  18025.  
  18026.  
  18027.  
  18028.  
  18029.  
  18030.  
  18031.  
  18032.  
  18033.  
  18034.  
  18035.  
  18036.  
  18037.  
  18038.  
  18039.  
  18040.  
  18041.  
  18042.  
  18043.  
  18044.  
  18045.  
  18046.  
  18047.  
  18048.  
  18049.  
  18050.  
  18051.                          The Hobbit House String Library               page 289
  18052.  
  18053.  
  18054.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18055.      ║ MIDSET.C     ║   file date: 03/13/93    page   1 of   1 ║ MIDSET.C     ║
  18056.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18057.  
  18058.      /*                       ┌───────────────────────┐               strmidset
  18059.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  18060.                               └───────────────────────┘
  18061.                                copyright(c) 1992, 1993
  18062.      
  18063.      function:       strmidset (STRing MIDdle SET)
  18064.      
  18065.      KWIC:           %set the %middle of a string to a given character
  18066.      
  18067.      syntax:         #include "hhstring.h"
  18068.                      char *strmidset(char *instring, int start,
  18069.                                       int nchar, char setchar)
  18070.      
  18071.      description:    set instring from "start" characters beyond the beginning
  18072.                      to "start"+"nchar" characters beyond the beginning to
  18073.                      setchar
  18074.      
  18075.      returns:        a pointer to the string
  18076.      
  18077.      comments:       if start+nchar would go beyond the end of the string,
  18078.                      overflow will NOT be allowed and the set will terminate
  18079.                      in front of the final 0 of the string. If start itself
  18080.                      would start beyond the end of the string, then the string
  18081.                      remains unchanged.
  18082.      
  18083.                      The string pointed to by the return value of this function
  18084.                      is in the calling function's space. The return value is
  18085.                      provided as a convenience, not a necessity.
  18086.      
  18087.      keywords:       string, middle, set
  18088.      
  18089.      key sentence:   changes a specified number of characters in a string,
  18090.                      starting at a specified point, to a specified set
  18091.                      character
  18092.      
  18093.      see also:       str{ lf | mid | rt }set{new}
  18094.      
  18095.      usage example:  compiled/executed/verified on 2/4/93
  18096.      
  18097.                      char *Astring = "This is the string";
  18098.                      strmidset(Astring, 8, 3, '-');
  18099.                      printf("%s", Astring);
  18100.      
  18101.                      This is --- string
  18102.      
  18103.                               ┌───────────────────────┐
  18104.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  18105.                               └───────────────────────┘                      */
  18106.  
  18107.  
  18108.  
  18109.  
  18110.  
  18111.  
  18112.      page 290            The Hobbit House String Library
  18113.  
  18114.  
  18115.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18116.      ║ MIDSETW.C    ║   file date: 03/13/93    page   1 of   2 ║ MIDSETW.C    ║
  18117.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18118.  
  18119.      /*                       ┌───────────────────────┐            strmidsetnew
  18120.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  18121.                               └───────────────────────┘
  18122.                                copyright(c) 1992, 1993
  18123.      
  18124.      function:       strmidsetnew (STRing MIDdle SET to NEW string)
  18125.      
  18126.      KWIC:           %set the %middle of a string to a given character
  18127.      
  18128.      syntax:         #include "hhstring.h"
  18129.                      char *strmidsetnew(char *newstring, char *instring,
  18130.                                          int start, int nchar, char setchar)
  18131.      
  18132.      description:    create newstring equal to instring except that from
  18133.                      "start" characters beyond the beginning to "start" +
  18134.                      "nchar" characters beyond the beginning, newstring
  18135.                      consists of "setchar".
  18136.      
  18137.      returns:        a pointer to newstring
  18138.      
  18139.      comments:       if start+nchar would go beyond the end of instring, the
  18140.                      entire right side of newstring will consist of setchar,
  18141.                      but newstring will have the same length as instring. If
  18142.                      start itself would start beyond the end of the instring,
  18143.                      then newstring will be identical to instring.
  18144.      
  18145.                      The string pointed to by the return value of this function
  18146.                      is in the calling function's space. The return value is
  18147.                      provided as a convenience, not a necessity.
  18148.      
  18149.                      Setting newstring = instring WILL NOT WORK with this
  18150.                      function and overlapping newstring/instring will not work
  18151.                      in general although in some special cases it will. Analyse
  18152.                      the source code if you need more details.
  18153.      
  18154.      keywords:       string, middle, set, new
  18155.      
  18156.      key sentence:   changes a specified number of characters in a string,
  18157.                      starting at a specified point in the string, to a
  18158.                      specified set character, and puts the results into a
  18159.                      new string
  18160.      
  18161.      see also:       str{ lf | mid | rt }set{new}
  18162.      
  18163.  
  18164.  
  18165.  
  18166.  
  18167.  
  18168.  
  18169.  
  18170.  
  18171.  
  18172.  
  18173.                          The Hobbit House String Library               page 291
  18174.  
  18175.  
  18176.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18177.      ║ MIDSETW.C    ║   file date: 03/13/93    page   2 of   2 ║ MIDSETW.C    ║
  18178.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18179.  
  18180.      
  18181.      
  18182.      usage example:  compiled/executed/verified on 2/4/93
  18183.      
  18184.                      char Bstring[80];
  18185.                      char *Astring = "Name Date Amount Number";
  18186.                      strmidsetnew(Bstring, Astring, 10, 6, '-');
  18187.                      printf("%s", Bstring);
  18188.      
  18189.                      Name Date ------ Number
  18190.      
  18191.                               ┌───────────────────────┐
  18192.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  18193.                               └───────────────────────┘                      */
  18194.  
  18195.  
  18196.  
  18197.  
  18198.  
  18199.  
  18200.  
  18201.  
  18202.  
  18203.  
  18204.  
  18205.  
  18206.  
  18207.  
  18208.  
  18209.  
  18210.  
  18211.  
  18212.  
  18213.  
  18214.  
  18215.  
  18216.  
  18217.  
  18218.  
  18219.  
  18220.  
  18221.  
  18222.  
  18223.  
  18224.  
  18225.  
  18226.  
  18227.  
  18228.  
  18229.  
  18230.  
  18231.  
  18232.  
  18233.  
  18234.      page 292            The Hobbit House String Library
  18235.  
  18236.  
  18237.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18238.      ║ REPEAT.C     ║   file date: 03/13/93    page   1 of   1 ║ REPEAT.C     ║
  18239.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18240.  
  18241.      /*                       ┌───────────────────────┐               strrepeat
  18242.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  18243.                               └───────────────────────┘
  18244.                                copyright(c) 1992, 1993
  18245.      
  18246.      function:       strrepeat (STRing REPEAT into another string)
  18247.      
  18248.      KWIC:           create a string by %repeating a shorter string into it
  18249.      
  18250.      syntax:         #include "hhstring.h"
  18251.                      char *strrepeat(char *newstring, char *instring, int n);
  18252.      
  18253.      description:    repeats instring into newstring, n times
  18254.      
  18255.      returns:        a pointer to newstring
  18256.      
  18257.      comments:       The new string must have enough room to contain n
  18258.                      repetitions of instring, else there be dragons
  18259.      
  18260.      keywords:       string, repeat
  18261.      
  18262.      key sentence:   creates a string by repeating a shorter string into it
  18263.                      a specified number of times
  18264.      
  18265.      see also:       strrepeat{n}
  18266.      
  18267.      usage example:  compiled/executed/verified on 12/13/92
  18268.      
  18269.                      char makeit[80];
  18270.                      char *msg = "do it now --- ";
  18271.                      strrepeat(makeit, msg, 3);
  18272.                      printf("%s", makeit);
  18273.      
  18274.                      do it now --- do it now --- do it now ---
  18275.      
  18276.                               ┌───────────────────────┐
  18277.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  18278.                               └───────────────────────┘                      */
  18279.  
  18280.  
  18281.  
  18282.  
  18283.  
  18284.  
  18285.  
  18286.  
  18287.  
  18288.  
  18289.  
  18290.  
  18291.  
  18292.  
  18293.  
  18294.  
  18295.                          The Hobbit House String Library               page 293
  18296.  
  18297.  
  18298.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18299.      ║ REPEATN.C    ║   file date: 03/13/93    page   1 of   2 ║ REPEATN.C    ║
  18300.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18301.  
  18302.      /*                       ┌───────────────────────┐              strrepeatn
  18303.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  18304.                               └───────────────────────┘
  18305.                                copyright(c) 1992, 1993
  18306.      
  18307.      function:       strrepeatn (STRing, REPEAT into another string,
  18308.                                  with N-char limit)
  18309.      
  18310.      KWIC:           create a string by %repeating a shorter string into it and
  18311.                      limit the output to a specified %size
  18312.      
  18313.      syntax:         #include "hhstring.h"
  18314.                      char *strrepeatn(char *newstring, char *instring,
  18315.                                       int ntimes, nchars);
  18316.      
  18317.      description:    repeats instring into newstring, ntimes times but limits
  18318.                      the created string to nchars characters. If nchars is
  18319.                      reached, a '\0' is put into the newstring at the "nchar"th
  18320.                      position. Note that if the character limit is not reached,
  18321.                      there is automatically a '\0' in the output string from
  18322.                      the last strcat function and the output string will be
  18323.                      shorter than nchars.
  18324.      
  18325.      returns:        a pointer to newstring
  18326.      
  18327.      comments:       The new string must have enough room to contain nchars
  18328.                      characters.
  18329.      
  18330.                      The string pointed to by the return value of this function
  18331.                      is in the calling function's space. The return value is
  18332.                      provided as a convenience, not a necessity.
  18333.      
  18334.      keywords:       string, repeat, size
  18335.      
  18336.      key sentence:   creates a string by repeating a shorter string into it a
  18337.                      specified number of times but limits the final string
  18338.                      length to a specified size
  18339.                      
  18340.      see also:       strrepeat{n}
  18341.      
  18342.  
  18343.  
  18344.  
  18345.  
  18346.  
  18347.  
  18348.  
  18349.  
  18350.  
  18351.  
  18352.  
  18353.  
  18354.  
  18355.  
  18356.      page 294            The Hobbit House String Library
  18357.  
  18358.  
  18359.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18360.      ║ REPEATN.C    ║   file date: 03/13/93    page   2 of   2 ║ REPEATN.C    ║
  18361.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18362.  
  18363.      
  18364.      
  18365.      usage example:  compiled/executed/verified on 2/25/93
  18366.      
  18367.                      char msg[80] = "do it now --- ";
  18368.                      char makeit[80];
  18369.                      strrepeatn(makeit, msg, 3, 33);
  18370.                      printf("-->%s<--", makeit);
  18371.      
  18372.                      -->do it now --- do it now --- do it<--
  18373.      
  18374.                               ┌───────────────────────┐
  18375.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  18376.                               └───────────────────────┘                      */
  18377.  
  18378.  
  18379.  
  18380.  
  18381.  
  18382.  
  18383.  
  18384.  
  18385.  
  18386.  
  18387.  
  18388.  
  18389.  
  18390.  
  18391.  
  18392.  
  18393.  
  18394.  
  18395.  
  18396.  
  18397.  
  18398.  
  18399.  
  18400.  
  18401.  
  18402.  
  18403.  
  18404.  
  18405.  
  18406.  
  18407.  
  18408.  
  18409.  
  18410.  
  18411.  
  18412.  
  18413.  
  18414.  
  18415.  
  18416.  
  18417.                          The Hobbit House String Library               page 295
  18418.  
  18419.  
  18420.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18421.      ║ REVERSE.C    ║   file date: 03/13/93    page   1 of   1 ║ REVERSE.C    ║
  18422.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18423.  
  18424.      /*                       ┌───────────────────────┐              strreverse
  18425.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  18426.                               └───────────────────────┘
  18427.                                copyright(c) 1992, 1993
  18428.      
  18429.      function:       strreverse (STRing REVERSE)
  18430.      
  18431.      KWIC:           %reverse the contents of a string
  18432.      
  18433.      syntax:         #include "hhstring.h"
  18434.                      char *strreverse(char *instring)
  18435.      
  18436.      description:    reverses the contents of instring
  18437.      
  18438.      returns:        a pointer to the string
  18439.      
  18440.      comments:       The string pointed to by the return value of this function
  18441.                      is in the calling function's space. The return value is
  18442.                      provided as a convenience, not a necessity.
  18443.      
  18444.      keywords:       string, reverse
  18445.      
  18446.      key sentence:   reverses the contents of a string, end to end
  18447.      
  18448.      see also:       strreverse{new}
  18449.      
  18450.      usage example:  compiled/executed/verified on 12/13/92
  18451.      
  18452.                      char *Astring = "abcdef0123456789";
  18453.                      strreverse(Astring);
  18454.                      printf("%s", Astring);
  18455.      
  18456.                      9876543210fedcba
  18457.      
  18458.                               ┌───────────────────────┐
  18459.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  18460.                               └───────────────────────┘                      */
  18461.  
  18462.  
  18463.  
  18464.  
  18465.  
  18466.  
  18467.  
  18468.  
  18469.  
  18470.  
  18471.  
  18472.  
  18473.  
  18474.  
  18475.  
  18476.  
  18477.  
  18478.      page 296            The Hobbit House String Library
  18479.  
  18480.  
  18481.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18482.      ║ REVERSEW.C   ║   file date: 03/13/93    page   1 of   1 ║ REVERSEW.C   ║
  18483.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18484.  
  18485.      /*                       ┌───────────────────────┐           strreversenew
  18486.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  18487.                               └───────────────────────┘
  18488.                                copyright(c) 1992, 1993
  18489.      
  18490.      function:       strreversenew (STRing REVERSE to NEW string)
  18491.      
  18492.      KWIC:           %reverse the contents of a string
  18493.      
  18494.      syntax:         #include "hhstring.h"
  18495.                      char *strreversenew(char *newstring, char *instring)
  18496.      
  18497.      description:    creates newstring as the reverse of instring
  18498.      
  18499.      returns:        a pointer to the new string
  18500.      
  18501.      comments:       The string pointed to by the return value of this function
  18502.                      is in the calling function's space. The return value is
  18503.                      provided as a convenience, not a necessity.
  18504.      
  18505.                      Setting newstring = instring WILL NOT WORK with this
  18506.                      function nor will overlapping newstring with instring by
  18507.                      even one character. You could create some interesting
  18508.                      results by overlapping but they would NOT be pure string
  18509.                      reversal.
  18510.      
  18511.      keywords:       string, reverse, new
  18512.      
  18513.      key sentence:   reverses the contents of a string, end to end, and puts
  18514.                      the result into a new string
  18515.      
  18516.      see also:       strreverse{new}
  18517.      
  18518.      usage example:  compiled/executed/verified on 12/13/92
  18519.      
  18520.                      char *Astring = "abcdef0123456789";
  18521.                      char Bstring[80];
  18522.                      strreversenew(Bstring, Astring);
  18523.                      printf("%s", Bstring);
  18524.      
  18525.                      9876543210fedcba
  18526.      
  18527.                               ┌───────────────────────┐
  18528.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  18529.                               └───────────────────────┘                      */
  18530.  
  18531.  
  18532.  
  18533.  
  18534.  
  18535.  
  18536.  
  18537.  
  18538.  
  18539.                          The Hobbit House String Library               page 297
  18540.  
  18541.  
  18542.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18543.      ║ RIT.C        ║   file date: 03/13/93    page   1 of   1 ║ RIT.C        ║
  18544.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18545.  
  18546.      /*                       ┌───────────────────────┐                strright
  18547.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  18548.                               └───────────────────────┘
  18549.                                copyright(c) 1992, 1993
  18550.      
  18551.      function:       strright (STRing RIGHT)
  18552.      
  18553.      KWIC:           get n characters from the %right side of a string
  18554.      
  18555.      syntax:         #include "hhstring.h"
  18556.                      char *strright(char *instring, int nchar)
  18557.      
  18558.      description:    modify instring so that it contains only the "n"
  18559.                      character on the right side of the original string.
  18560.                      If the instring is shorter than nchar, then it
  18561.                      remains unchanged.
  18562.      
  18563.      returns:        a pointer to instring
  18564.      
  18565.      comments:       The string pointed to by the return value of this function
  18566.                      is in the calling function's space. The return value is
  18567.                      provided as a convenience, not a necessity.
  18568.      
  18569.      keywords:       string, right
  18570.      
  18571.      key sentence:   modifies a string so that it consist of only its rightmost
  18572.                      original n characters
  18573.      
  18574.      see also:       strleft{new}    strmid{new}
  18575.                      strright{new}   strmidn{new}
  18576.      
  18577.      usage example:  compiled/executed/verified on 12/13/92
  18578.      
  18579.                      char *Astring = "name size date other";
  18580.                      strright(Astring, 5);
  18581.                      printf("%s", Astring);
  18582.      
  18583.                      other
  18584.                               ┌───────────────────────┐
  18585.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  18586.                               └───────────────────────┘                      */
  18587.  
  18588.  
  18589.  
  18590.  
  18591.  
  18592.  
  18593.  
  18594.  
  18595.  
  18596.  
  18597.  
  18598.  
  18599.  
  18600.      page 298            The Hobbit House String Library
  18601.  
  18602.  
  18603.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18604.      ║ RITW.C       ║   file date: 03/13/93    page   1 of   2 ║ RITW.C       ║
  18605.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18606.  
  18607.      /*                       ┌───────────────────────┐             strrightnew
  18608.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  18609.                               └───────────────────────┘
  18610.                                copyright(c) 1992, 1993
  18611.      
  18612.      function:       strrightnew (STRing RIGHT to NEW string)
  18613.      
  18614.      KWIC:           get n characters from the %right side of a string
  18615.      
  18616.      syntax:         #include "hhstring.h"
  18617.                      char *strrightnew(char *newstring, char *instring, int n)
  18618.      
  18619.      description:    move the "n" characters on the right side of instring to
  18620.                      newstring. If the requested substring is larger than
  18621.                      instring, then newstring will be the same as instring.
  18622.                      In any case, instring is unchanged.
  18623.      
  18624.      returns:        a pointer to newstring
  18625.      
  18626.      comments:       The user passes the newstring pointer to the function
  18627.                      which then fills up newstring with the appropriate
  18628.                      characters from the old string (possibly including ALL of
  18629.                      them).
  18630.      
  18631.                      The string pointed to by the return value of this function
  18632.                      is in the calling function's space. The return value is
  18633.                      provided as a convenience, not a necessity.
  18634.      
  18635.                      Setting newstring = instring will work OK with this
  18636.                      function but overlapping newstring/instring may or may
  18637.                      not work so if you must overlap, do it cautiously.
  18638.      
  18639.      keywords:       string, right, new
  18640.      
  18641.      key sentence:   copies the rightmost n characters from a string into a
  18642.                      new string
  18643.      
  18644.      see also:       strleft{new}    strmid{new}
  18645.                      strright{new}   strmidn{new}
  18646.      
  18647.  
  18648.  
  18649.  
  18650.  
  18651.  
  18652.  
  18653.  
  18654.  
  18655.  
  18656.  
  18657.  
  18658.  
  18659.  
  18660.  
  18661.                          The Hobbit House String Library               page 299
  18662.  
  18663.  
  18664.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18665.      ║ RITW.C       ║   file date: 03/13/93    page   2 of   2 ║ RITW.C       ║
  18666.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18667.  
  18668.      
  18669.      
  18670.      usage example:  compiled/executed/verified on 12/13/92
  18671.      
  18672.                      char *Astring = "name size date other";
  18673.                      char Newstring[80];
  18674.                      strrightnew(Newstring, Astring, 5);
  18675.                      printf("%s", Newstring);
  18676.      
  18677.                      other
  18678.                               ┌───────────────────────┐
  18679.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  18680.                               └───────────────────────┘                      */
  18681.  
  18682.  
  18683.  
  18684.  
  18685.  
  18686.  
  18687.  
  18688.  
  18689.  
  18690.  
  18691.  
  18692.  
  18693.  
  18694.  
  18695.  
  18696.  
  18697.  
  18698.  
  18699.  
  18700.  
  18701.  
  18702.  
  18703.  
  18704.  
  18705.  
  18706.  
  18707.  
  18708.  
  18709.  
  18710.  
  18711.  
  18712.  
  18713.  
  18714.  
  18715.  
  18716.  
  18717.  
  18718.  
  18719.  
  18720.  
  18721.  
  18722.      page 300            The Hobbit House String Library
  18723.  
  18724.  
  18725.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18726.      ║ RITDEL.C     ║   file date: 03/13/93    page   1 of   1 ║ RITDEL.C     ║
  18727.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18728.  
  18729.      /*                       ┌───────────────────────┐                strrtdel
  18730.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  18731.                               └───────────────────────┘
  18732.                                copyright(c) 1992, 1993
  18733.      
  18734.      function:       strrtdel (STRing RighT DELete)
  18735.      
  18736.      KWIC:           %delete characters from the %right side of a string
  18737.      
  18738.      syntax:         #include "hhstring.h"
  18739.                      char *strrtdel(char *instring, int nchar)
  18740.      
  18741.      description:    move the terminating 0 for instring so as to delete the
  18742.                      rightmost nchar characters
  18743.      
  18744.      returns:        a pointer to instring
  18745.      
  18746.      comments:       If nchar is greater than the length of instring, then
  18747.                      instring will be set to a null string and the rest of
  18748.                      memory will not be disturbed.
  18749.      
  18750.                      The string pointed to by the return value of this function
  18751.                      is in the calling function's space. The return value is
  18752.                      provided as a convenience, not a necessity.
  18753.      
  18754.      keywords:       string, right, delete, truncate
  18755.      
  18756.      key sentence:   deletes the rightmost n characters from a string
  18757.      
  18758.      see also:       str< lf | mid | rt >del{new}
  18759.      
  18760.      usage example:  compiled/executed/verified on 12/13/92
  18761.      
  18762.                      char *Astring = "this is the input string";
  18763.                      strrtdel(Astring, 7);
  18764.                      printf("%s", Astring);
  18765.      
  18766.                      this is the input
  18767.      
  18768.                               ┌───────────────────────┐
  18769.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  18770.                               └───────────────────────┘                      */
  18771.  
  18772.  
  18773.  
  18774.  
  18775.  
  18776.  
  18777.  
  18778.  
  18779.  
  18780.  
  18781.  
  18782.  
  18783.                          The Hobbit House String Library               page 301
  18784.  
  18785.  
  18786.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18787.      ║ RITDELW.C    ║   file date: 03/13/93    page   1 of   1 ║ RITDELW.C    ║
  18788.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18789.  
  18790.      /*                       ┌───────────────────────┐             strrtdelnew
  18791.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  18792.                               └───────────────────────┘
  18793.                                copyright(c) 1992, 1993
  18794.      
  18795.      function:       strrtdelnew (STRing RighT DELete to NEW string)
  18796.      
  18797.      KWIC:           %delete characters from the %right side of a string
  18798.      
  18799.      syntax:         #include "hhstring.h"
  18800.                      char *strrtdelnew(char *newstring, char *instring,
  18801.                                        int nchar)
  18802.      
  18803.      description:    newstring is created identical to instring except that
  18804.                      the rightmost n characters of instring are not included
  18805.                      in instring.
  18806.      
  18807.      returns:        a pointer to newstring
  18808.      
  18809.      comments:       The string pointed to by the return value of this function
  18810.                      is in the calling function's space. The return value is
  18811.                      provided as a convenience, not a necessity.
  18812.      
  18813.                      Setting newstring = instring will work OK with this
  18814.                      function but overlapping newstring/instring may or may
  18815.                      not work so if you must overlap, do it cautiously.
  18816.      
  18817.      keywords:       string, right, delete, new, truncate
  18818.      
  18819.      key sentence:   creates a new string which is the same as a given string
  18820.                      except that the rightmost n characters are not included in
  18821.                      the new string
  18822.      
  18823.      see also:       str< lf | mid | rt >del{new}
  18824.      
  18825.      usage example:  compiled/executed/verified on 12/13/92
  18826.      
  18827.                      char *Astring = "this is the input string";
  18828.                      char Bstring[90];
  18829.                      strrtdelnew(Bstring, Astring, 7);
  18830.                      printf("%s", Bstring);
  18831.      
  18832.                      this is the input
  18833.      
  18834.                               ┌───────────────────────┐
  18835.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  18836.                               └───────────────────────┘                      */
  18837.  
  18838.  
  18839.  
  18840.  
  18841.  
  18842.  
  18843.  
  18844.      page 302            The Hobbit House String Library
  18845.  
  18846.  
  18847.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18848.      ║ RITJUS.C     ║   file date: 03/13/93    page   1 of   1 ║ RITJUS.C     ║
  18849.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18850.  
  18851.      /*                       ┌───────────────────────┐               strrtjust
  18852.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  18853.                               └───────────────────────┘
  18854.                                copyright(c) 1992, 1993
  18855.      
  18856.      function:       strrtjust (STRing RighT JUStify)
  18857.      
  18858.      KWIC:           %right %justify a string
  18859.      
  18860.      syntax:         #include "hhstring.h"
  18861.                      char *strrtjust(char *instring)
  18862.      
  18863.      description:    the contents of instring are shifted right to remove any
  18864.                      whitespace (blanks or TABs) on the right side. Blanks are
  18865.                      shifted in on the left to replace the characters shifted
  18866.                      out to the right.
  18867.      
  18868.      returns:        a pointer to instring
  18869.      
  18870.      comments:       note that only one blank is shifted in on the right for
  18871.                      each TAB that is shifted out on the left
  18872.      
  18873.                      The string pointed to by the return value of this function
  18874.                      is in the calling function's space. The return value is
  18875.                      provided as a convenience, not a necessity.
  18876.      
  18877.      keywords:       string, right, justify
  18878.      
  18879.      key sentence:   right justifies a string
  18880.      
  18881.      see also:       str< lf | rt >just{new}         strcenter{n}{new}
  18882.      
  18883.      usage example:  compiled/executed/verified on 12/13/92
  18884.      
  18885.                      char *Astring = "Right Justify this string   ";
  18886.                      strrtjust(Astring);
  18887.                      printf("-->%s<--", Astring);
  18888.      
  18889.                      -->   Right Justify this string<--
  18890.      
  18891.                               ┌───────────────────────┐
  18892.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  18893.                               └───────────────────────┘                      */
  18894.  
  18895.  
  18896.  
  18897.  
  18898.  
  18899.  
  18900.  
  18901.  
  18902.  
  18903.  
  18904.  
  18905.                          The Hobbit House String Library               page 303
  18906.  
  18907.  
  18908.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18909.      ║ RITJUSW.C    ║   file date: 03/13/93    page   1 of   2 ║ RITJUSW.C    ║
  18910.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18911.  
  18912.      /*                       ┌───────────────────────┐            strrtjustnew
  18913.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  18914.                               └───────────────────────┘
  18915.                                copyright(c) 1992, 1993
  18916.      
  18917.      function:       strrtjustnew (STRing RighT JUStify to NEW string)
  18918.      
  18919.      KWIC:           %right %justify a string
  18920.      
  18921.      syntax:         #include "hhstring.h"
  18922.                      char *strrtjustnew(char *newstring, char *instring)
  18923.      
  18924.      description:    the contents of a string are shifted right to remove any
  18925.                      whitespace (blanks or TABs) on the right side. Blanks are
  18926.                      shifted in on the left to replace the characters shifted
  18927.                      out to the right. The results go to newstring. instring
  18928.                      is not changed.
  18929.      
  18930.      returns:        a pointer to newstring
  18931.      
  18932.      comments:       NOTE that only one blank is shifted in on the left to
  18933.                      replace a TAB that is deleted from the right side of the
  18934.                      string.
  18935.      
  18936.                      The string pointed to by the return value of this function
  18937.                      is in the calling function's space. The return value is
  18938.                      provided as a convenience, not a necessity.
  18939.      
  18940.                      Setting newstring = instring will work OK with this
  18941.                      function but overlapping newstring/instring may or may
  18942.                      not work so if you must overlap, do it cautiously.
  18943.      
  18944.      keywords:       string, right, justify, new
  18945.      
  18946.      key sentence:   right justifies a string with the results going to a
  18947.                      new string
  18948.      
  18949.      see also:       str< lf | rt >just{new}         strcenter{n}{new}
  18950.      
  18951.  
  18952.  
  18953.  
  18954.  
  18955.  
  18956.  
  18957.  
  18958.  
  18959.  
  18960.  
  18961.  
  18962.  
  18963.  
  18964.  
  18965.  
  18966.      page 304            The Hobbit House String Library
  18967.  
  18968.  
  18969.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  18970.      ║ RITJUSW.C    ║   file date: 03/13/93    page   2 of   2 ║ RITJUSW.C    ║
  18971.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  18972.  
  18973.      
  18974.      
  18975.      usage example:  compiled/executed/verified on 12/13/92
  18976.      
  18977.                      char *Astring = "Right Justify this string   ";
  18978.                      char Bstring[80];
  18979.                      strrtjustnew(Bstring, Astring);
  18980.                      printf("-->%s<--", Bstring);
  18981.      
  18982.                      -->   Right Justify this string<--
  18983.      
  18984.                               ┌───────────────────────┐
  18985.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  18986.                               └───────────────────────┘                      */
  18987.  
  18988.  
  18989.  
  18990.  
  18991.  
  18992.  
  18993.  
  18994.  
  18995.  
  18996.  
  18997.  
  18998.  
  18999.  
  19000.  
  19001.  
  19002.  
  19003.  
  19004.  
  19005.  
  19006.  
  19007.  
  19008.  
  19009.  
  19010.  
  19011.  
  19012.  
  19013.  
  19014.  
  19015.  
  19016.  
  19017.  
  19018.  
  19019.  
  19020.  
  19021.  
  19022.  
  19023.  
  19024.  
  19025.  
  19026.  
  19027.                          The Hobbit House String Library               page 305
  19028.  
  19029.  
  19030.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19031.      ║ RITPAD.C     ║   file date: 03/13/93    page   1 of   1 ║ RITPAD.C     ║
  19032.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19033.  
  19034.      /*                       ┌───────────────────────┐                strrtpad
  19035.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19036.                               └───────────────────────┘
  19037.                                copyright(c) 1992, 1993
  19038.      
  19039.      function:       strrtpad (STRing RighT PAD)
  19040.      
  19041.      KWIC:           %pad a string on the %right
  19042.      
  19043.      syntax:         #include "hhstring.h"
  19044.                      char *strrtpad(char *instring, int nchar, char PadChar)
  19045.      
  19046.      description:    pads instring on the right with nchar occurrences of
  19047.                      PadChar
  19048.      
  19049.      WARNING:        the input string MUST have enough memory space beyond its
  19050.                      terminating 0 to accommodate the extra characters. This
  19051.                      function necessarily assumes that the space is available.
  19052.                      If the space is not available, this function will destroy
  19053.                      whatever is in the memory space following the input
  19054.                      string.
  19055.      
  19056.      returns:        a pointer to instring
  19057.      
  19058.      comments:       The string pointed to by the return value of this function
  19059.                      is in the calling function's space. The return value is
  19060.                      provided as a convenience, not a necessity.
  19061.      
  19062.      keywords:       string, right, pad, size
  19063.      
  19064.      key sentence:   changes the size of a string by adding n copies of a pad
  19065.                      character onto its right side
  19066.      
  19067.      see also:       str< lf | mid | rt >pad{new}
  19068.      
  19069.      usage example:  compiled/executed/verified on 12/13/92
  19070.      
  19071.                      char Astring[80] = "this is Astring";
  19072.                      strrtpad(Astring, 5, 'x');
  19073.                      printf("%s", Astring);
  19074.      
  19075.                      this is Astringxxxxx
  19076.      
  19077.                               ┌───────────────────────┐
  19078.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19079.                               └───────────────────────┘                      */
  19080.  
  19081.  
  19082.  
  19083.  
  19084.  
  19085.  
  19086.  
  19087.  
  19088.      page 306            The Hobbit House String Library
  19089.  
  19090.  
  19091.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19092.      ║ RITPADW.C    ║   file date: 03/13/93    page   1 of   1 ║ RITPADW.C    ║
  19093.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19094.  
  19095.      /*                       ┌───────────────────────┐             strrtpadnew
  19096.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19097.                               └───────────────────────┘
  19098.                                copyright(c) 1992, 1993
  19099.      
  19100.      function:       strrtpadnew (STRing RighT PAD to NEW string)
  19101.      
  19102.      KWIC:           %pad a string on the %right
  19103.      
  19104.      syntax:         #include "hhstring.h"
  19105.                      char *strrtpadnew(char *newstring, char *instring,
  19106.                                        int nchar, char PadChar)
  19107.      
  19108.      description:    creates newstring which has instring as its left side and
  19109.                      is padded on the right with nchar occurrences of PadChar
  19110.      
  19111.      returns:        a pointer to newstring.
  19112.      
  19113.      comments:       The string pointed to by the return value of this function
  19114.                      is in the calling function's space. The return value is
  19115.                      provided as a convenience, not a necessity.
  19116.      
  19117.                      Setting newstring = instring will work OK with this
  19118.                      function but overlapping newstring/instring may or may
  19119.                      not work so if you must overlap, do it cautiously.
  19120.      
  19121.      keywords:       string, right, pad, new, size
  19122.      
  19123.      key sentence:   changes the size of a string by adding n copies of a pad
  19124.                      character to the right side, puts the result into a new
  19125.                      string, and returns a pointer to the new string
  19126.      
  19127.      see also:       str< lf | mid | rt >pad{new}
  19128.      
  19129.      usage example:  compiled/executed/verified on 12/13/92
  19130.      
  19131.                      char *Astring = "this is Astring";
  19132.                      char Bstring[80];
  19133.                      strrtpadnew(Bstring, Astring, 5, 'x');
  19134.                      printf("%s", Bstring);
  19135.      
  19136.                      this is Astringxxxxx
  19137.      
  19138.                               ┌───────────────────────┐
  19139.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19140.                               └───────────────────────┘                      */
  19141.  
  19142.  
  19143.  
  19144.  
  19145.  
  19146.  
  19147.  
  19148.  
  19149.                          The Hobbit House String Library               page 307
  19150.  
  19151.  
  19152.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19153.      ║ RITROT.C     ║   file date: 03/13/93    page   1 of   1 ║ RITROT.C     ║
  19154.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19155.  
  19156.      /*                       ┌───────────────────────┐                strrtrot
  19157.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19158.                               └───────────────────────┘
  19159.                                copyright(c) 1992, 1993
  19160.      
  19161.      function:       strrtrot (STRing RighT ROTate)
  19162.      
  19163.      KWIC:           %rotate a string to the %right
  19164.      
  19165.      syntax:         #include <alloc.h>
  19166.                      #include "hhstring.h"
  19167.                      char *strrtrot(char *instring, int nchar)
  19168.      
  19169.      description:    rotates instring right by nchar places
  19170.      
  19171.      returns:        a pointer to instring
  19172.      
  19173.      comments:       if nchar is greater than the length of the string, then it
  19174.                      is taken MODULO the string length prior to the rotate, so
  19175.                      the rotate is correct.
  19176.      
  19177.                      The string pointed to by the return value of this function
  19178.                      is in the calling function's space. The return value is
  19179.                      provided as a convenience, not a necessity.
  19180.      
  19181.      keywords:       string, right, rotate
  19182.      
  19183.      key sentence:   rotates a string right n places
  19184.      
  19185.      see also:       str< lf | rt >sh{new}           str< lf | rt >rot{new}
  19186.      
  19187.      usage example:  compiled/executed/verified on 12/13/92
  19188.      
  19189.                      char *Astring = "This is the string to rotate---";
  19190.                      strrtrot(Astring, 3);
  19191.                      printf("%s", Astring);
  19192.      
  19193.                      ---This is the string to rotate
  19194.      
  19195.                               ┌───────────────────────┐
  19196.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19197.                               └───────────────────────┘                      */
  19198.  
  19199.  
  19200.  
  19201.  
  19202.  
  19203.  
  19204.  
  19205.  
  19206.  
  19207.  
  19208.  
  19209.  
  19210.      page 308            The Hobbit House String Library
  19211.  
  19212.  
  19213.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19214.      ║ RITROTW.C    ║   file date: 03/13/93    page   1 of   1 ║ RITROTW.C    ║
  19215.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19216.  
  19217.      /*                       ┌───────────────────────┐             strrtrotnew
  19218.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19219.                               └───────────────────────┘
  19220.                                copyright(c) 1992, 1993
  19221.      
  19222.      function:       strrtrotnew (STRing RighT ROTate to NEW string)
  19223.      
  19224.      KWIC:           %rotate a string to the %right
  19225.      
  19226.      syntax:         #include "hhstring.h"
  19227.                      char *strrtrotnew(char *newstring, char *instring,
  19228.                                        int nchar)
  19229.      
  19230.      description:    newstring is created by rotating instring nchar places to
  19231.                      the right.
  19232.      
  19233.      returns:        a pointer to newstring
  19234.      
  19235.      comments:       if nchar is greater than the length of the string, then
  19236.                      it is taken MODULO the length of the string before the
  19237.                      rotate is done, so the rotate is correct
  19238.      
  19239.                      The string pointed to by the return value of this function
  19240.                      is in the calling function's space. The return value is
  19241.                      provided as a convenience, not a necessity.
  19242.      
  19243.                      Setting newstring = instring WILL NOT WORK with this
  19244.                      function and overlapping newstring/instring may or may
  19245.                      not work so if you must overlap, do it cautiously.
  19246.      
  19247.      keywords:       string, right, rotate, new
  19248.      
  19249.      key sentence:   rotates a string right n places and puts the result
  19250.                      into a new string
  19251.      
  19252.      see also:       str< lf | rt >sh{new}           str< lf | rt >rot{new}
  19253.      
  19254.      usage example:  compiled/executed/verified on 12/13/92
  19255.      
  19256.                      char *Astring = "This is the string to rotate---";
  19257.                      char Bstring[80];
  19258.                      strrtrotnew(Bstring, Astring, 3);
  19259.                      printf("%s", Bstring);
  19260.      
  19261.                      ---This is the string to rotate
  19262.      
  19263.                               ┌───────────────────────┐
  19264.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19265.                               └───────────────────────┘                      */
  19266.  
  19267.  
  19268.  
  19269.  
  19270.  
  19271.                          The Hobbit House String Library               page 309
  19272.  
  19273.  
  19274.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19275.      ║ RITSET.C     ║   file date: 03/13/93    page   1 of   1 ║ RITSET.C     ║
  19276.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19277.  
  19278.      /*                       ┌───────────────────────┐                strrtset
  19279.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19280.                               └───────────────────────┘
  19281.                                copyright(c) 1992, 1993
  19282.      
  19283.      function:       strrtset (STRing RighT SET)
  19284.      
  19285.      KWIC:           %set the %right side of a string to a given character
  19286.      
  19287.      syntax:         #include "hhstring.h"
  19288.                      char *strrtset(char *instring, int nchar, char setchar)
  19289.      
  19290.      description:    setchar is put into the rightmost nchar characters of
  19291.                      instring
  19292.      
  19293.      returns:        a pointer to instring.
  19294.      
  19295.      comments:       if nchar is greater than the length of the string,
  19296.                      overflow will NOT be allowed, but the entire string will
  19297.                      be set to setchar
  19298.      
  19299.                      The string pointed to by the return value of this function
  19300.                      is in the calling function's space. The return value is
  19301.                      provided as a convenience, not a necessity.
  19302.      
  19303.      keywords:       string, right, set
  19304.      
  19305.      key sentence:   sets the rightmost n characters of a string with a given
  19306.                      set character
  19307.      
  19308.      see also:       str{ lf | mid | rt }set{new}
  19309.      
  19310.      usage example:  compiled/executed/verified on 2/4/93
  19311.      
  19312.                      char *Astring = "This is the string";
  19313.                      strrtset(Astring, 6, '/');
  19314.                      printf("%s", Astring);
  19315.      
  19316.                      This is the //////
  19317.      
  19318.                               ┌───────────────────────┐
  19319.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19320.                               └───────────────────────┘                      */
  19321.  
  19322.  
  19323.  
  19324.  
  19325.  
  19326.  
  19327.  
  19328.  
  19329.  
  19330.  
  19331.  
  19332.      page 310            The Hobbit House String Library
  19333.  
  19334.  
  19335.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19336.      ║ RITSETW.C    ║   file date: 03/13/93    page   1 of   1 ║ RITSETW.C    ║
  19337.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19338.  
  19339.      /*                       ┌───────────────────────┐             strrtsetnew
  19340.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19341.                               └───────────────────────┘
  19342.                                copyright(c) 1992, 1993
  19343.      
  19344.      function:       strrtsetnew (STRing RighT SET to NEW string)
  19345.      
  19346.      KWIC:           %set the %right side of a string
  19347.      
  19348.      syntax:         #include "hhstring.h"
  19349.                      char *strrtsetnew(char *newstring, char *instring,
  19350.                                         int nchar, char setchar)
  19351.      
  19352.      description:    setchar is put into the rightmost nchar characters of
  19353.                      newstring and the remaining (if any) leftmost portion
  19354.                      of newstring is filled from instring
  19355.      
  19356.      returns:        a pointer to newstring.
  19357.      
  19358.      comments:       if nchar is greater than the length of instring,
  19359.                      newstring will be entirely set to setchar
  19360.      
  19361.                      The string pointed to by the return value of this function
  19362.                      is in the calling function's space. The return value is
  19363.                      provided as a convenience, not a necessity.
  19364.      
  19365.                      Setting newstring = instring will work OK with this
  19366.                      function but overlapping newstring/instring may or may
  19367.                      not work so if you must overlap, do it cautiously.
  19368.      
  19369.      keywords:       string, right, set, new
  19370.      
  19371.      key sentence:   sets the rightmost n characters of a string with a
  19372.                      given set character and puts the results into a new string
  19373.      
  19374.      see also:       str{ lf | mid | rt }set{new}
  19375.      
  19376.      usage example:  compiled/executed/verified on 2/4/93
  19377.      
  19378.                      char *Astring = "This is the string";
  19379.                      char Bstring[80];
  19380.                      strrtsetnew(Bstring, Astring, 6, '+');
  19381.                      printf("%s", Bstring);
  19382.      
  19383.                      This is the ++++++
  19384.      
  19385.                               ┌───────────────────────┐
  19386.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19387.                               └───────────────────────┘                      */
  19388.  
  19389.  
  19390.  
  19391.  
  19392.  
  19393.                          The Hobbit House String Library               page 311
  19394.  
  19395.  
  19396.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19397.      ║ RITSHF.C     ║   file date: 03/13/93    page   1 of   1 ║ RITSHF.C     ║
  19398.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19399.  
  19400.      /*                       ┌───────────────────────┐                 strrtsh
  19401.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19402.                               └───────────────────────┘
  19403.                                copyright(c) 1992, 1993
  19404.      
  19405.      function:       strrtsh (STRing RighT SHift)
  19406.      
  19407.      KWIC:           %shift a string to the %right
  19408.      
  19409.      syntax:         #include "hhstring.h"
  19410.                      char *strrtsh (char *instring, int nchar)
  19411.      
  19412.      description:    shift instring to the right nchar places and put blanks on
  19413.                      the left to replace the characters shifted out
  19414.      
  19415.      returns:        a pointer to instring
  19416.      
  19417.      comments:       The string pointed to by the return value of this function
  19418.                      is in the calling function's space. The return value is
  19419.                      provided as a convenience, not a necessity.
  19420.      
  19421.      keywords:       string, right, shift
  19422.      
  19423.      key sentence:   shifts a string right n places, shifting blanks in on the
  19424.                      left
  19425.      
  19426.      see also:       str< lf | rt >sh{new}           str< lf | rt >rot{new}
  19427.      
  19428.      usage example:  compiled/executed/verified on 12/13/92
  19429.      
  19430.                      char *string1 = "this is string #1";
  19431.                      printf("\n->%s<-", string1);
  19432.                      strrtsh(string1, 3);
  19433.                      printf("\n->%s<-", string1);
  19434.      
  19435.                      ->this is string #1<-
  19436.                      ->   this is string<-
  19437.      
  19438.                               ┌───────────────────────┐
  19439.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19440.                               └───────────────────────┘                      */
  19441.  
  19442.  
  19443.  
  19444.  
  19445.  
  19446.  
  19447.  
  19448.  
  19449.  
  19450.  
  19451.  
  19452.  
  19453.  
  19454.      page 312            The Hobbit House String Library
  19455.  
  19456.  
  19457.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19458.      ║ RITSHFW.C    ║   file date: 03/13/93    page   1 of   1 ║ RITSHFW.C    ║
  19459.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19460.  
  19461.      /*                       ┌───────────────────────┐              strrtshnew
  19462.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19463.                               └───────────────────────┘
  19464.                                copyright(c) 1992, 1993
  19465.      
  19466.      function:       strrtshnew (STRing RighT SHift to NEW string)
  19467.      
  19468.      KWIC:           %shift a string to the %right
  19469.      
  19470.      syntax:         #include "hhstring.h"
  19471.                      char *strrtshnew(char *newstring, char *instring,
  19472.                                       int nchar)
  19473.      
  19474.      description:    newstring is filled with the characters from instring such
  19475.                      that newstring is instring shifted right nchar places and
  19476.                      filled with blanks on the left to replace the characters
  19477.                      shifted right
  19478.      
  19479.      returns:        a pointer to newstring
  19480.      
  19481.      comments:       The string pointed to by the return value of this function
  19482.                      is in the calling function's space. The return value is
  19483.                      provided as a convenience, not a necessity.
  19484.      
  19485.                      Setting newstring = instring WILL NOT WORK with this
  19486.                      function and overlapping newstring/instring may or may
  19487.                      not work so if you must overlap, do it cautiously.
  19488.      
  19489.      keywords:       string, right, shift, new
  19490.      
  19491.      key sentence:   shifts a string n places to the right, shifting blanks in
  19492.                      on the left, with the result going to a new string
  19493.      
  19494.      see also:       str< lf | rt >sh{new}           str< lf | rt >rot{new}
  19495.      
  19496.      usage example:  compiled/executed/verified on 12/13/92
  19497.      
  19498.                      char Astring[80] = "this is string1";
  19499.                      char Bstring[80];
  19500.                      strrtshnew(Bstring, Astring, 8);
  19501.                      printf("->%s<-\n->%s<-", Astring, Bstring);
  19502.      
  19503.                      ->this is string1<-
  19504.                      ->        this is<-
  19505.      
  19506.                               ┌───────────────────────┐
  19507.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19508.                               └───────────────────────┘                      */
  19509.  
  19510.  
  19511.  
  19512.  
  19513.  
  19514.  
  19515.                          The Hobbit House String Library               page 313
  19516.  
  19517.  
  19518.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19519.      ║ RITSIZ.C     ║   file date: 03/13/93    page   1 of   1 ║ RITSIZ.C     ║
  19520.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19521.  
  19522.      /*                       ┌───────────────────────┐               strrtsize
  19523.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19524.                               └───────────────────────┘
  19525.                                copyright(c) 1992, 1993
  19526.      
  19527.      function:       strrtsize (STRing, pad/truncate on RighT to force SIZE)
  19528.      
  19529.      KWIC:           modify the %right side of a string to force a fixed %size
  19530.      
  19531.      syntax:         #include "hhstring.h"
  19532.                      char *strrtsize(char *instring, int size)
  19533.      
  19534.      description:    instring is padded on the right with blanks or truncated
  19535.                      on the right, to force it to size characters
  19536.      
  19537.      returns:        a pointer to instring
  19538.      
  19539.      comments:       this function necessarily assumes that the string space
  19540.                      is big enough to hold any string expansion requested.
  19541.                      If this is not the case then memory locations will be
  19542.                      wiped out and the results will be unpredictable.
  19543.      
  19544.                      The string pointed to by the return value of this function
  19545.                      is in the calling function's space. The return value is
  19546.                      provided as a convenience, not a necessity.
  19547.      
  19548.      keywords:       string, right, size, truncate
  19549.      
  19550.      key sentence:   pads or truncates a string on the right to force it to a
  19551.                      given size
  19552.      
  19553.      see also:       str< lf | rt >size{new}
  19554.      
  19555.      usage example:  compiled/executed/verified on 12/13/92
  19556.      
  19557.                      char Astring[80] = "This is the first string";
  19558.                      char Bstring[80] = "second";
  19559.                      strrtsize(Astring, 11);
  19560.                      strrtsize(Bstring, 11);
  19561.                      printf("\n%s<--", Astring);
  19562.                      printf("\n%s<--", Bstring);
  19563.      
  19564.                      This is the<--
  19565.                      second     <--
  19566.      
  19567.                               ┌───────────────────────┐
  19568.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19569.                               └───────────────────────┘                      */
  19570.  
  19571.  
  19572.  
  19573.  
  19574.  
  19575.  
  19576.      page 314            The Hobbit House String Library
  19577.  
  19578.  
  19579.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19580.      ║ RITSIZW.C    ║   file date: 03/13/93    page   1 of   2 ║ RITSIZW.C    ║
  19581.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19582.  
  19583.      /*                       ┌───────────────────────┐            strrtsizenew
  19584.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19585.                               └───────────────────────┘
  19586.                                copyright(c) 1992, 1993
  19587.      
  19588.      function:       strrtsizenew (STRing, pad/truncate on RighT to force
  19589.                                      SIZE to NEW string)
  19590.      
  19591.      KWIC:           modify the %right side of a string to force a fixed %size
  19592.      
  19593.      syntax:         #include "hhstring.h"
  19594.                      char *strrtsizenew(char *newstring, char *instring,
  19595.                                         int size)
  19596.      
  19597.      description:    if the string is to be made bigger, then it is padded on
  19598.                      the right with blanks. If it is to be made smaller, then
  19599.                      it is truncated on the right. The result is put into the
  19600.                      new string.
  19601.      
  19602.      returns:        a pointer to newstring
  19603.      
  19604.      comments:       this function necessarily assumes that the new string
  19605.                      space is big enough to hold any string expansion
  19606.                      requested. If this is not the case then memory locations
  19607.                      will be wiped out and the results will be unpredictable.
  19608.      
  19609.                      The string pointed to by the return value of this function
  19610.                      is in the calling function's space. The return value is
  19611.                      provided as a convenience, not a necessity.
  19612.      
  19613.      keywords:       string, right, size, new, truncate
  19614.      
  19615.      key sentence:   pads or truncates a string on the right to force a given
  19616.                      size, with the result going to a new string
  19617.      
  19618.      see also:       str< lf | rt >size{new}
  19619.      
  19620.  
  19621.  
  19622.  
  19623.  
  19624.  
  19625.  
  19626.  
  19627.  
  19628.  
  19629.  
  19630.  
  19631.  
  19632.  
  19633.  
  19634.  
  19635.  
  19636.  
  19637.                          The Hobbit House String Library               page 315
  19638.  
  19639.  
  19640.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19641.      ║ RITSIZW.C    ║   file date: 03/13/93    page   2 of   2 ║ RITSIZW.C    ║
  19642.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19643.  
  19644.      
  19645.      
  19646.      usage example:  compiled/executed/verified on 12/13/92
  19647.      
  19648.                      char *Astring = "This is the first string";
  19649.                      char *Bstring = "second";
  19650.                      char Cstring[80];
  19651.                      char Dstring[80];
  19652.                      strrtsizenew(Cstring, Astring, 11);
  19653.                      strrtsizenew(Dstring, Bstring, 11);
  19654.                      printf("\n%s<--", Cstring);
  19655.                      printf("\n%s<--", Dstring);
  19656.      
  19657.                      This is the<--
  19658.                      second     <--
  19659.      
  19660.                               ┌───────────────────────┐
  19661.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19662.                               └───────────────────────┘                      */
  19663.  
  19664.  
  19665.  
  19666.  
  19667.  
  19668.  
  19669.  
  19670.  
  19671.  
  19672.  
  19673.  
  19674.  
  19675.  
  19676.  
  19677.  
  19678.  
  19679.  
  19680.  
  19681.  
  19682.  
  19683.  
  19684.  
  19685.  
  19686.  
  19687.  
  19688.  
  19689.  
  19690.  
  19691.  
  19692.  
  19693.  
  19694.  
  19695.  
  19696.  
  19697.  
  19698.      page 316            The Hobbit House String Library
  19699.  
  19700.  
  19701.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19702.      ║ RITTRM.C     ║   file date: 03/13/93    page   1 of   1 ║ RITTRM.C     ║
  19703.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19704.  
  19705.      /*                       ┌───────────────────────┐               strrttrim
  19706.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19707.                               └───────────────────────┘
  19708.                                copyright(c) 1992, 1993
  19709.      
  19710.      function:       strrttrim (STRing RighT TRIM whitespace)
  19711.      
  19712.      KWIC:           %trim %whitespace (blanks and tabs) from the %right side
  19713.                      of a string
  19714.      
  19715.      syntax:         #include "hhstring.h"
  19716.                      char *strrttrim(char *instring)
  19717.      
  19718.      description:    trims blanks and tabs from the right side of a string
  19719.      
  19720.      returns:        a pointer to instring
  19721.      
  19722.      comments:       if the string consists of nothing but whitespace, then it
  19723.                      will end up as a null string
  19724.      
  19725.                      The string pointed to by the return value of this function
  19726.                      is in the calling function's space. The return value is
  19727.                      provided as a convenience, not a necessity.
  19728.      
  19729.      keywords:       string, right, trim, whitespace, blank, tab, truncate
  19730.      
  19731.      key sentence:   trims whitespace (blanks and tabs) from the right side of
  19732.                      a string
  19733.                                                                               
  19734.      see also:       str{ lf | rt }trim{new}
  19735.      
  19736.      usage example:  compiled/executed/verified on 12/13/92
  19737.      
  19738.                      char *Astring = "This string has 3 trailing blanks   ";
  19739.                      strrttrim(Astring);
  19740.                      printf("%s<---", Astring);
  19741.      
  19742.                      This string has 3 trailing blanks<---
  19743.      
  19744.      
  19745.                               ┌───────────────────────┐
  19746.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19747.                               └───────────────────────┘                      */
  19748.  
  19749.  
  19750.  
  19751.  
  19752.  
  19753.  
  19754.  
  19755.  
  19756.  
  19757.  
  19758.  
  19759.                          The Hobbit House String Library               page 317
  19760.  
  19761.  
  19762.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19763.      ║ RITTRMW.C    ║   file date: 03/13/93    page   1 of   1 ║ RITTRMW.C    ║
  19764.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19765.  
  19766.      /*                       ┌───────────────────────┐            strrttrimnew
  19767.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19768.                               └───────────────────────┘
  19769.                                copyright(c) 1992, 1993
  19770.      
  19771.      function:       strrttrimnew (STRing RighT TRIM whitespace to NEW string)
  19772.      
  19773.      KWIC:           %trim %whitespace (blanks and tabs) from the %right side
  19774.                      of a string
  19775.      
  19776.      syntax:         #include "hhstring.h"
  19777.                      char *strrttrimnew(char *newstring, char *instring)
  19778.      
  19779.      description:    trims blanks and tabs from the right side of instring and
  19780.                      puts the results into newstring
  19781.      
  19782.      returns:        a pointer to newstring
  19783.      
  19784.      comments:       if the string consists of nothing but whitespace, then
  19785.                      the new string will be a null string.
  19786.      
  19787.                      The string pointed to by the return value of this function
  19788.                      is in the calling function's space. The return value is
  19789.                      provided as a convenience, not a necessity.
  19790.      
  19791.                      Setting newstring = instring will work OK with this
  19792.                      function but overlapping newstring/instring may or may
  19793.                      not work so if you must overlap, do it cautiously.
  19794.      
  19795.      keywords:       string, right, trim, whitespace, blank, tab, new, truncate
  19796.      
  19797.      key sentence:   trims whitespace (tabs and blanks) from the right side of
  19798.                      a string and puts the result into a new string
  19799.      
  19800.      see also:       str{ lf | rt }trim{new}
  19801.      
  19802.      usage example:  compiled/executed/verified on 12/13/92
  19803.      
  19804.                      char *Astring = "This string has 3 trailing blanks   ";
  19805.                      char Bstring[80];
  19806.                      strrttrimnew(Bstring, Astring);
  19807.                      printf("%s<---", Bstring);
  19808.      
  19809.                      This string has 3 trailing blanks<---
  19810.      
  19811.                               ┌───────────────────────┐
  19812.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19813.                               └───────────────────────┘                      */
  19814.  
  19815.  
  19816.  
  19817.  
  19818.  
  19819.  
  19820.      page 318            The Hobbit House String Library
  19821.  
  19822.  
  19823.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19824.      ║ SUBCNT.C     ║   file date: 03/13/93    page   1 of   1 ║ SUBCNT.C     ║
  19825.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19826.  
  19827.      /*                       ┌───────────────────────┐             strsubcount
  19828.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19829.                               └───────────────────────┘
  19830.                                copyright(c) 1992, 1993
  19831.      
  19832.      function:       strsubcount (STRing, SUBstring, COUNT # of occurrences)
  19833.      
  19834.      KWIC:           return the %count of occurrences of a %substring in a
  19835.                      string
  19836.      
  19837.      syntax:         #include "hhstring.h"
  19838.                      int strsubcount (char *instring, char *substring)
  19839.      
  19840.      description:    the number of occurrences of substring in instring is
  19841.                      returned
  19842.      
  19843.      returns:        the number of occurrences of substring
  19844.      
  19845.      comments:       this function "counts" substring occurrences in a way such
  19846.                      that one occurrence is not counted as part of the string
  19847.                      when searching for the next occurrence. Thus the string:
  19848.      
  19849.                                      "one one one one one one"
  19850.      
  19851.                      when examined for the substring "one one", will find not
  19852.                      5 occurrences, but 3 occurrences.
  19853.      
  19854.      keywords:       string, substring, count
  19855.      
  19856.      key sentence:   gives the number of occurrences of a substring in a string
  19857.      
  19858.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  19859.                                      strsubrpl< {i} | {i}all >{new}
  19860.      
  19861.      usage example:  compiled/executed/verified on 12/18/92
  19862.      
  19863.                      char *Astring = "This, that, and the other";
  19864.                      char *Bstring = "This one one one, that one one one";
  19865.                      printf("\n%d", strsubcount(Astring, "th"));
  19866.                      printf("\n%d", strsubcount(Bstring, "one one"));
  19867.      
  19868.                      3
  19869.                      2
  19870.      
  19871.                               ┌───────────────────────┐
  19872.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19873.                               └───────────────────────┘                      */
  19874.  
  19875.  
  19876.  
  19877.  
  19878.  
  19879.  
  19880.  
  19881.                          The Hobbit House String Library               page 319
  19882.  
  19883.  
  19884.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19885.      ║ SUBCNTI.C    ║   file date: 03/13/93    page   1 of   1 ║ SUBCNTI.C    ║
  19886.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19887.  
  19888.      /*                       ┌───────────────────────┐            strsubcounti
  19889.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19890.                               └───────────────────────┘
  19891.                                copyright(c) 1992, 1993
  19892.      
  19893.      function:       strsubcounti (STRing, SUBstring, COUNT number of
  19894.                                    case-Independant occurrences)
  19895.      
  19896.      KWIC:           return the %count of occurrences, %independant of case,
  19897.                      of a %substring in a string
  19898.      
  19899.      syntax:         #include "hhstring.h"
  19900.                      int strsubcounti(char *instring, char *substring)
  19901.      
  19902.      description:    the number of case-independent occurrences of substring
  19903.                      in instring is returned
  19904.      
  19905.      returns:        the number of case-independent occurrences of substring
  19906.      
  19907.      comments:       none
  19908.      
  19909.      keywords:       string, substring, count, case-independent
  19910.      
  19911.      key sentence:   gives the number of case-independent occurrences of a
  19912.                      substring in a string
  19913.      
  19914.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  19915.                                      strsubrpl< {i} | {i}all >{new}
  19916.      
  19917.      usage example:  compiled/executed/verified on 12/19/92
  19918.      
  19919.                      char *Astring = "This, that, and the other";
  19920.                      char *Bstring = "This one one one, that one one one";
  19921.                      printf("\n%d", strsubcounti(Astring, "th"));
  19922.                      printf("\n%d", strsubcounti(Bstring, "ONE one"));
  19923.      
  19924.                      4
  19925.                      2
  19926.      
  19927.                               ┌───────────────────────┐
  19928.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19929.                               └───────────────────────┘                      */
  19930.  
  19931.  
  19932.  
  19933.  
  19934.  
  19935.  
  19936.  
  19937.  
  19938.  
  19939.  
  19940.  
  19941.  
  19942.      page 320            The Hobbit House String Library
  19943.  
  19944.  
  19945.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  19946.      ║ SUBDL.C      ║   file date: 03/13/93    page   1 of   1 ║ SUBDL.C      ║
  19947.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  19948.  
  19949.      /*                       ┌───────────────────────┐               strsubdel
  19950.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  19951.                               └───────────────────────┘
  19952.                                copyright(c) 1992, 1993
  19953.      
  19954.      function:       strsubdel (STRing, SUBstring DELete)
  19955.      
  19956.      KWIC:           %delete a %substring from a string
  19957.      
  19958.      syntax:         #include "hhstring.h"
  19959.                      char *strsubdel(char *instring,  char *substring)
  19960.      
  19961.      description:    the first occurrence of substring is deleted from instring
  19962.      
  19963.      returns:        a pointer to instring
  19964.      
  19965.      comments:       none
  19966.      
  19967.      keywords:       string, substring, delete
  19968.      
  19969.      key sentence:   deletes the first occurrence in a string of a given
  19970.                                                                       substring
  19971.      
  19972.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  19973.                                      strsubrpl< {i} | {i}all >{new}
  19974.      
  19975.      usage example:  compiled/executed/verified on 12/15/92
  19976.      
  19977.                      char *Astring = "This is the Sample String";
  19978.                      strsubdel(Astring, "Sample ");
  19979.                      printf("\n%s", Astring);
  19980.                      printf("\n%s", strsubdel(Astring, "the "));
  19981.      
  19982.                      This is the String
  19983.                      This is String
  19984.      
  19985.                               ┌───────────────────────┐
  19986.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  19987.                               └───────────────────────┘                      */
  19988.  
  19989.  
  19990.  
  19991.  
  19992.  
  19993.  
  19994.  
  19995.  
  19996.  
  19997.  
  19998.  
  19999.  
  20000.  
  20001.  
  20002.  
  20003.                          The Hobbit House String Library               page 321
  20004.  
  20005.  
  20006.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20007.      ║ SUBDLA.C     ║   file date: 03/13/93    page   1 of   1 ║ SUBDLA.C     ║
  20008.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20009.  
  20010.      /*                       ┌───────────────────────┐            strsubdelall
  20011.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  20012.                               └───────────────────────┘
  20013.                                copyright(c) 1992, 1993
  20014.      
  20015.      function:       strsubdelall (STRing SUBstring DELete ALL occurrences)
  20016.      
  20017.      KWIC:           %delete %all occurrences of a %substring in a string
  20018.      
  20019.      syntax:         #include "hhstring.h"
  20020.                      char *strsubdelall(char *instring, char *substring)
  20021.      
  20022.      description:    all occurrences of substring in instring are deleted
  20023.      
  20024.      returns:        a pointer to instring
  20025.      
  20026.      comments:       none
  20027.      
  20028.      keywords:       string, substring, delete, all
  20029.      
  20030.      key sentence:   deletes all occurrences in a string of a given substring
  20031.      
  20032.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  20033.                                      strsubrpl< {i} | {i}all >{new}
  20034.      
  20035.      usage example:  compiled/executed/verified on 12/18/92
  20036.      
  20037.                      char *Astring = "This one and that one and the other one";
  20038.                      strsubdelall(Astring, "one");
  20039.                      printf("\n%s", Astring);
  20040.                      printf("\n%s", strsubdelall(Astring, "th"));
  20041.      
  20042.                      This  and that  and the other
  20043.                      This  and at  and e oer
  20044.      
  20045.                               ┌───────────────────────┐
  20046.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  20047.                               └───────────────────────┘                      */
  20048.  
  20049.  
  20050.  
  20051.  
  20052.  
  20053.  
  20054.  
  20055.  
  20056.  
  20057.  
  20058.  
  20059.  
  20060.  
  20061.  
  20062.  
  20063.  
  20064.      page 322            The Hobbit House String Library
  20065.  
  20066.  
  20067.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20068.      ║ SUBDLAW.C    ║   file date: 03/13/93    page   1 of   1 ║ SUBDLAW.C    ║
  20069.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20070.  
  20071.      /*                       ┌───────────────────────┐         strsubdelallnew
  20072.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  20073.                               └───────────────────────┘
  20074.                                copyright(c) 1992, 1993
  20075.      
  20076.      function:       strsubdelallnew (STRing SUBstring DELete ALL occurrences,
  20077.                                       to NEW string)
  20078.      
  20079.      KWIC:           %delete %all occurrences of a %substring in a string
  20080.      
  20081.      syntax:         #include "hhstring.h"
  20082.                      char *strsubdelallnew(char *newstring, char *instring,
  20083.                                            char *substring)
  20084.      
  20085.      description:    all occurrences of substring in instring are deleted, but
  20086.                      the result goes to newstring, not instring
  20087.      
  20088.      returns:        a pointer to newstring
  20089.      
  20090.      comments:       none
  20091.      
  20092.      keywords:       string, substring, delete, all, new
  20093.      
  20094.      key sentence:   deletes all occurrences in a string of a given substring,
  20095.                      and puts the result into a new string
  20096.      
  20097.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  20098.                                      strsubrpl< {i} | {i}all >{new}
  20099.      
  20100.      usage example:  compiled/executed/verified on 2/19/93
  20101.      
  20102.                      char *Astring = "This one and that one and the other one";
  20103.                      char Bstring[80];
  20104.                      char Cstring[80];
  20105.                      strsubdelallnew(Bstring, Astring, "one");
  20106.                      printf("\n%s", Bstring);
  20107.                      printf("\n%s", strsubdelallnew(Cstring, Bstring, "th"));
  20108.      
  20109.                      This  and that  and the other
  20110.                      This  and at  and e oer
  20111.      
  20112.                               ┌───────────────────────┐
  20113.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  20114.                               └───────────────────────┘                      */
  20115.  
  20116.  
  20117.  
  20118.  
  20119.  
  20120.  
  20121.  
  20122.  
  20123.  
  20124.  
  20125.                          The Hobbit House String Library               page 323
  20126.  
  20127.  
  20128.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20129.      ║ SUBDLI.C     ║   file date: 03/13/93    page   1 of   1 ║ SUBDLI.C     ║
  20130.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20131.  
  20132.      /*                       ┌───────────────────────┐              strsubdeli
  20133.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  20134.                               └───────────────────────┘
  20135.                                copyright(c) 1992, 1993
  20136.      
  20137.      function:       strsubdeli (STRing, SUBstring DELete, case-Independant)
  20138.      
  20139.      KWIC:           %delete a %substring, %independant of case, from a string
  20140.      
  20141.      syntax:         #include "hhstring.h"
  20142.                      char *strsubdeli(char *instring, char *substring)
  20143.      
  20144.      description:    the first case-independent occurrence of substring is
  20145.                      deleted from instring
  20146.      
  20147.      returns:        a pointer to instring
  20148.      
  20149.      comments:       dealing with case independence causes this function to
  20150.                      be significantly larger and slower than the case-
  20151.                      dependant version (strsubdel)
  20152.      
  20153.      keywords:       string, substring, delete, case-independent
  20154.      
  20155.      key sentence:   deletes from a string the first case-independent
  20156.                                                                      occurrence
  20157.                      of a given substring
  20158.      
  20159.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  20160.                                      strsubrpl< {i} | {i}all >{new}
  20161.      
  20162.      usage example:  compiled/executed/verified on 2/25/93
  20163.      
  20164.                      char *Astring = "This is the Sample String";
  20165.                      strsubdeli(Astring, "SAMPLE ");
  20166.                      printf("\n%s", Astring);
  20167.                      printf("\n%s", strsubdeli(Astring, "THE "));
  20168.      
  20169.                      This is the String
  20170.                      This is String
  20171.      
  20172.                               ┌───────────────────────┐
  20173.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  20174.                               └───────────────────────┘                      */
  20175.  
  20176.  
  20177.  
  20178.  
  20179.  
  20180.  
  20181.  
  20182.  
  20183.  
  20184.  
  20185.  
  20186.      page 324            The Hobbit House String Library
  20187.  
  20188.  
  20189.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20190.      ║ SUBDLIA.C    ║   file date: 03/13/93    page   1 of   1 ║ SUBDLIA.C    ║
  20191.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20192.  
  20193.      /*                       ┌───────────────────────┐           strsubdeliall
  20194.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  20195.                               └───────────────────────┘
  20196.                                copyright(c) 1992, 1993
  20197.      
  20198.      function:       strsubdeliall (STRing, SUBstring DELete, case-Independant,
  20199.                                     All occurrences)
  20200.      
  20201.      KWIC:           %delete %all occurrences, %independant of case, of a
  20202.                      %substring from a string
  20203.      
  20204.      syntax:         #include <alloc.h>
  20205.                      #include "hhstring.h"
  20206.                      char *strsubdeliall(char *instring, char *substring)
  20207.      
  20208.      description:    all occurrences of substring, independent of case, in
  20209.                      instring are deleted
  20210.      
  20211.      returns:        a pointer to instring
  20212.      
  20213.      comments:       dealing with case independence causes this function to
  20214.                      be significantly larger and slower than the case-
  20215.                      dependant version (strsubdelall)
  20216.      
  20217.      keywords:       string, substring, delete, all, case-independent
  20218.      
  20219.      key sentence:   deletes from a string all case-independent occurrences
  20220.                      of a given substring
  20221.      
  20222.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  20223.                                      strsubrpl< {i} | {i}all >{new}
  20224.      
  20225.      usage example:  compiled/executed/verified on 12/31/92
  20226.      
  20227.                      char *Astring = "This one and that one and the other one";
  20228.                      strsubdeliall(Astring, "one");
  20229.                      printf("\n%s", Astring);
  20230.                      printf("\n%s", strsubdeliall(Astring, "th"));
  20231.      
  20232.                      This  and that  and the other
  20233.                      is  and at  and e oer
  20234.      
  20235.                               ┌───────────────────────┐
  20236.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  20237.                               └───────────────────────┘                      */
  20238.  
  20239.  
  20240.  
  20241.  
  20242.  
  20243.  
  20244.  
  20245.  
  20246.  
  20247.                          The Hobbit House String Library               page 325
  20248.  
  20249.  
  20250.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20251.      ║ SUBDLIAW.C   ║   file date: 03/13/93    page   1 of   1 ║ SUBDLIAW.C   ║
  20252.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20253.  
  20254.      /*                       ┌───────────────────────┐        strsubdeliallnew
  20255.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  20256.                               └───────────────────────┘
  20257.                                copyright(c) 1992, 1993
  20258.      
  20259.      function:       strsubdeliallnew (STRing SUBstring DELete ALL occurrences,
  20260.                                        Independant of case, to NEW string)
  20261.      
  20262.      KWIC:           %delete %all occurrences, %independant of case, of a
  20263.                      %substring in a string
  20264.      
  20265.      syntax:         #include "hhstring.h"
  20266.                      char *strsubdeliallnew(char *newstring, char *instring,
  20267.                                             char *substring)
  20268.      
  20269.      description:    all occurrences of substring in instring, independent of
  20270.                      case, are deleted, with the result going to newstring
  20271.      
  20272.      returns:        a pointer to newstring
  20273.      
  20274.      comments:       none
  20275.      
  20276.      keywords:       string, substring, delete, all, new, case-independent
  20277.      
  20278.      key sentence:   deletes from a string all case-independent occurrences of
  20279.                      a given substring and puts the result into a new string
  20280.      
  20281.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  20282.                                      strsubrpl< {i} | {i}all >{new}
  20283.      
  20284.      usage example:  compiled/executed/verified on 2/19/93
  20285.      
  20286.                      char *Astring = "This one and that one and the other one";
  20287.                      char Bstring[80];
  20288.                      char Cstring[80];
  20289.                      strsubdeliallnew(Bstring, Astring, "one");
  20290.                      printf("\n%s", Bstring);
  20291.                      printf("\n%s", strsubdeliallnew(Cstring, Bstring, "th"));
  20292.      
  20293.                      This  and that  and the other
  20294.                      is  and at  and e oer
  20295.      
  20296.                               ┌───────────────────────┐
  20297.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  20298.                               └───────────────────────┘                      */
  20299.  
  20300.  
  20301.  
  20302.  
  20303.  
  20304.  
  20305.  
  20306.  
  20307.  
  20308.      page 326            The Hobbit House String Library
  20309.  
  20310.  
  20311.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20312.      ║ SUBDLIW.C    ║   file date: 03/13/93    page   1 of   1 ║ SUBDLIW.C    ║
  20313.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20314.  
  20315.      /*                       ┌───────────────────────┐           strsubdelinew
  20316.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  20317.                               └───────────────────────┘
  20318.                                copyright(c) 1992, 1993
  20319.      
  20320.      function:       strsubdelinew (STRing, SUBstring DELete, case-Independant,
  20321.                                     to NEW string)
  20322.      
  20323.      KWIC:           %delete a %substring from a string, %independent of case
  20324.      
  20325.      syntax:         #include "hhstring.h"
  20326.                      char *strsubdelinew(char *newstring, char *instring,
  20327.                                          char *substring)
  20328.      
  20329.      description:    the first occurrence of substring in instring is deleted,
  20330.                      with the resulting string going to newstring, not back
  20331.                      into instring
  20332.      
  20333.      returns:        a pointer to newstring
  20334.      
  20335.      comments:       none
  20336.      
  20337.      keywords:       string, substring, delete, case-independent, new
  20338.      
  20339.      key sentence:   deletes from a string the first occurrence of a given
  20340.                      substring and puts the result into a new string
  20341.      
  20342.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  20343.                                      strsubrpl< {i} | {i}all >{new}
  20344.      
  20345.      usage example:  compiled/executed/verified on 12/19/92
  20346.      
  20347.                      char *Astring = "This is the Sample String";
  20348.                      char Bstring[80];
  20349.                      char Cstring[80];
  20350.                      strsubdelinew(Bstring, Astring, "SAMPLE ");
  20351.                      printf("\n%s", Bstring);
  20352.                      printf("\n%s", strsubdelinew(Cstring, Bstring, "THE "));
  20353.      
  20354.                      This is the String
  20355.                      This is String
  20356.      
  20357.                               ┌───────────────────────┐
  20358.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  20359.                               └───────────────────────┘                      */
  20360.  
  20361.  
  20362.  
  20363.  
  20364.  
  20365.  
  20366.  
  20367.  
  20368.  
  20369.                          The Hobbit House String Library               page 327
  20370.  
  20371.  
  20372.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20373.      ║ SUBDLW.C     ║   file date: 03/13/93    page   1 of   1 ║ SUBDLW.C     ║
  20374.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20375.  
  20376.      /*                       ┌───────────────────────┐            strsubdelnew
  20377.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  20378.                               └───────────────────────┘
  20379.                                copyright(c) 1992, 1993
  20380.      
  20381.      function:       strsubdelnew (STRing, SUBstring DELete, to NEW string)
  20382.      
  20383.      KWIC:           %delete a %substring from a string
  20384.      
  20385.      syntax:         #include "hhstring.h"
  20386.                      char *strsubdelnew(char *newstring, char *instring,
  20387.                                      char *substring)
  20388.      
  20389.      description:    the first occurrence of substring in instring is deleted,
  20390.                      with the result going to newstring
  20391.      
  20392.      returns:        a pointer to newstring
  20393.      
  20394.      comments:       none
  20395.      
  20396.      keywords:       string, substring, delete, new
  20397.      
  20398.      key sentence:   deletes from a string the first occurrence of a given
  20399.                      substring and puts the result into a new string
  20400.      
  20401.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  20402.                                      strsubrpl< {i} | {i}all >{new}
  20403.      
  20404.      usage example:  compiled/executed/verified on 12/19/92
  20405.      
  20406.                      char *Astring = "This is the Sample String";
  20407.                      char Bstring[80];
  20408.                      char Cstring[80];
  20409.                      strsubdelnew(Bstring, Astring, "Sample ");
  20410.                      printf("\n%s", Bstring);
  20411.                      printf("\n%s", strsubdelnew(Cstring, Bstring, "the "));
  20412.      
  20413.                      This is the String
  20414.                      This is String
  20415.      
  20416.                               ┌───────────────────────┐
  20417.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  20418.                               └───────────────────────┘                      */
  20419.  
  20420.  
  20421.  
  20422.  
  20423.  
  20424.  
  20425.  
  20426.  
  20427.  
  20428.  
  20429.  
  20430.      page 328            The Hobbit House String Library
  20431.  
  20432.  
  20433.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20434.      ║ SUBRP.C      ║   file date: 03/13/93    page   1 of   1 ║ SUBRP.C      ║
  20435.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20436.  
  20437.      /*                       ┌───────────────────────┐               strsubrpl
  20438.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  20439.                               └───────────────────────┘
  20440.                                copyright(c) 1992, 1993
  20441.      
  20442.      function:       strsubrpl (STRing, SUBstring RePLace)
  20443.      
  20444.      KWIC:           %replace one %substring with another
  20445.      
  20446.      syntax:         #include "hhstring.h"
  20447.                      char *strsubrpl(char *instring, char *fromstr,
  20448.                                      char *tostr)
  20449.      
  20450.      description:    the first occurrence of fromstr in instring is replaced
  20451.                      with tostr.
  20452.      
  20453.      returns:        pointer to the character in the modified instring which
  20454.                      follows the inserted tostr. If fromstr doesn't occur in
  20455.                      instring, then the return is a NULL.
  20456.      
  20457.      comments:       if tostr is larger that fromstr, then instring must be
  20458.                      large enough to accommodate the extra characters, else
  20459.                      there be dragons
  20460.      
  20461.      keywords:       string, substring, replace
  20462.      
  20463.      key sentence:   replaces, in a string, the first occurrence of one
  20464.                      substring with another substring
  20465.      
  20466.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  20467.                                      strsubrpl< {i} | {i}all >{new}
  20468.      
  20469.      usage example:  compiled/executed/verified on 12/15/92
  20470.      
  20471.                      char Astring[80] = "this that and the other that was";
  20472.                      strsubrpl(Astring, "that", "those");
  20473.                      printf("\n%s", Astring);
  20474.                      printf("\n%s", strsubrpl(Astring, "and the", "which"));
  20475.                      printf("\n%s", Astring);
  20476.      
  20477.                      this those and the other that was
  20478.                       other that was
  20479.                      this those which other that was
  20480.      
  20481.                               ┌───────────────────────┐
  20482.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  20483.                               └───────────────────────┘                      */
  20484.  
  20485.  
  20486.  
  20487.  
  20488.  
  20489.  
  20490.  
  20491.                          The Hobbit House String Library               page 329
  20492.  
  20493.  
  20494.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20495.      ║ SUBRPA.C     ║   file date: 03/13/93    page   1 of   2 ║ SUBRPA.C     ║
  20496.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20497.  
  20498.      /*                       ┌───────────────────────┐            strsubrplall
  20499.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  20500.                               └───────────────────────┘
  20501.                                copyright(c) 1992, 1993
  20502.      
  20503.      function:       strsubrplall (STRing, SUBstring RePLace ALL occurrences)
  20504.      
  20505.      KWIC:           %replace %all occurrences of one %substring with another
  20506.      
  20507.      syntax:         #include "hhstring.h"
  20508.                      int strsubrplall(char *instring, char *fromstr,
  20509.                                       char *tostr)
  20510.      
  20511.      
  20512.      description:    all occurrences of fromstr in instring are replaced with
  20513.                      tostr
  20514.      
  20515.      returns:        The number of times fromstr was found and replaced. If
  20516.                      fromstr doesn't occur in instring, then the return is 0.
  20517.      
  20518.      comments:       if tostr is larger that fromstr, then instring must be
  20519.                      large enough to accommodate the extra characters, else
  20520.                      there be dragons
  20521.      
  20522.                      The implementation starts each replace operation where
  20523.                      the last one left off, both for efficiency and so that
  20524.                      if tostr and fromstr are the same, function will not
  20525.                      hang up in an endless loop. This also has an impact on
  20526.                      how the function deals with situations where the
  20527.                      insertion of the substring creates a new occurrence of
  20528.                      fromstr. To wit: the result of
  20529.      
  20530.                              char Astring[80] = "the one one";
  20531.                              strsubrplall(Astring, "the one", "one the");
  20532.      
  20533.                      is "one the one", not "one one the"
  20534.      
  20535.      keywords:       string, substring, replace, all
  20536.      
  20537.      key sentence:   replaces, in a string, all occurrences of a one substring
  20538.                      with another substring
  20539.      
  20540.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  20541.                                      strsubrpl< {i} | {i}all >{new}
  20542.      
  20543.  
  20544.  
  20545.  
  20546.  
  20547.  
  20548.  
  20549.  
  20550.  
  20551.  
  20552.      page 330            The Hobbit House String Library
  20553.  
  20554.  
  20555.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20556.      ║ SUBRPA.C     ║   file date: 03/13/93    page   2 of   2 ║ SUBRPA.C     ║
  20557.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20558.  
  20559.      
  20560.      
  20561.      usage example:  compiled/executed/verified on 12/20/92
  20562.      
  20563.                      char Astring[80] = "This one, that one, the other one";
  20564.                      int num;
  20565.                      num = strsubrplall(Astring, "one", "thing");
  20566.                      printf("\n%d: %s", num, Astring);
  20567.                      num = strsubrplall(Astring, "th", "/");
  20568.                      printf("\n%d: %s", num, Astring);
  20569.      
  20570.                      3: This thing, that thing, the other thing
  20571.                      6: This /ing, /at /ing, /e o/er /ing
  20572.      
  20573.                               ┌───────────────────────┐
  20574.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  20575.                               └───────────────────────┘                      */
  20576.  
  20577.  
  20578.  
  20579.  
  20580.  
  20581.  
  20582.  
  20583.  
  20584.  
  20585.  
  20586.  
  20587.  
  20588.  
  20589.  
  20590.  
  20591.  
  20592.  
  20593.  
  20594.  
  20595.  
  20596.  
  20597.  
  20598.  
  20599.  
  20600.  
  20601.  
  20602.  
  20603.  
  20604.  
  20605.  
  20606.  
  20607.  
  20608.  
  20609.  
  20610.  
  20611.  
  20612.  
  20613.                          The Hobbit House String Library               page 331
  20614.  
  20615.  
  20616.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20617.      ║ SUBRPAW.C    ║   file date: 03/13/93    page   1 of   2 ║ SUBRPAW.C    ║
  20618.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20619.  
  20620.      /*                       ┌───────────────────────┐         strsubrplallnew
  20621.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  20622.                               └───────────────────────┘
  20623.                                copyright(c) 1992, 1993
  20624.      
  20625.      function:       strsubrplallnew (STRing, SUBstring RePLace ALL occurrences
  20626.                                       to NEW string)
  20627.      
  20628.      KWIC:           %replace %all occurrences of one %substring with another
  20629.      
  20630.      syntax:         #include "hhstring.h"
  20631.                      int strsubrplallnew(char *newstring, char *instring,
  20632.                                          char *fromstr, char *tostr)
  20633.      
  20634.      description:    all occurrences of fromstr in instring are replaced with
  20635.                      tostr with the result going to newstring, not instring.
  20636.                      If there are no occurrences, instring is just copied to
  20637.                      newstring.
  20638.      
  20639.      returns:        The number of times fromstr was found and replaced. If
  20640.                      fromstr doesn't occur in instring, then the return is 0.
  20641.      
  20642.      comments:       Because of the implementation technique used, newstring
  20643.                                                                            must
  20644.                      be at least as large as instring, and if tostr is larger
  20645.                                                                            than
  20646.                      fromstr, then newstring must be large enough to
  20647.                                                                     accommodate
  20648.                      the additional characters as well.
  20649.      
  20650.      keywords:       string, substring, replace, all, new
  20651.      
  20652.      key sentence:   replaces, in a string, all occurrences of one substring
  20653.                      with another substring and puts the result into a new
  20654.                      string
  20655.      
  20656.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  20657.                                      strsubrpl< {i} | {i}all >{new}
  20658.      
  20659.      usage example:  compiled/executed/verified on 12/20/92
  20660.      
  20661.                      char Astring[80] = "This one, that one, the other one";
  20662.                      char Bstring[80];
  20663.                      int num;
  20664.                      num = strsubrplallnew(Bstring, Astring, "one", "thing");
  20665.                      printf("\n%d: %s", num, Bstring);
  20666.                      num = strsubrplallnew(Astring, Bstring, "th", "/");
  20667.                      printf("\n%d: %s", num, Astring);
  20668.      
  20669.                      3: This thing, that thing, the other thing
  20670.                      6: This /ing, /at /ing, /e o/er /ing
  20671.      
  20672.                               ┌───────────────────────┐
  20673.  
  20674.      page 332            The Hobbit House String Library
  20675.  
  20676.  
  20677.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20678.      ║ SUBRPAW.C    ║   file date: 03/13/93    page   2 of   2 ║ SUBRPAW.C    ║
  20679.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20680.  
  20681.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  20682.                               └───────────────────────┘                      */
  20683.  
  20684.  
  20685.  
  20686.  
  20687.  
  20688.  
  20689.  
  20690.  
  20691.  
  20692.  
  20693.  
  20694.  
  20695.  
  20696.  
  20697.  
  20698.  
  20699.  
  20700.  
  20701.  
  20702.  
  20703.  
  20704.  
  20705.  
  20706.  
  20707.  
  20708.  
  20709.  
  20710.  
  20711.  
  20712.  
  20713.  
  20714.  
  20715.  
  20716.  
  20717.  
  20718.  
  20719.  
  20720.  
  20721.  
  20722.  
  20723.  
  20724.  
  20725.  
  20726.  
  20727.  
  20728.  
  20729.  
  20730.  
  20731.  
  20732.  
  20733.  
  20734.  
  20735.                          The Hobbit House String Library               page 333
  20736.  
  20737.  
  20738.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20739.      ║ SUBRPI.C     ║   file date: 03/13/93    page   1 of   1 ║ SUBRPI.C     ║
  20740.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20741.  
  20742.      /*                       ┌───────────────────────┐              strsubrpli
  20743.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  20744.                               └───────────────────────┘
  20745.                                copyright(c) 1992, 1993
  20746.      
  20747.      function:       strsubrpli (STRing, SUBstring, RePLace, case-Independant)
  20748.      
  20749.      KWIC:           %replace an occurrence, %independant of case, of one
  20750.                      %substring with another substring
  20751.      
  20752.      syntax:         #include "hhstring.h"
  20753.                      char *strsubrpli(char *instring, char *oldsub,
  20754.                                       char *newsub)
  20755.      
  20756.      description:    the first case-independent occurrence of oldsub in
  20757.                                                                        instring
  20758.                      is replaced by newsub
  20759.      
  20760.      returns:        pointer to the character in the modified instring which
  20761.                      follows the inserted newsub. If oldsub doesn't occur in
  20762.                      instring, then the return is a NULL.
  20763.      
  20764.      comments:       none
  20765.      
  20766.      keywords:       string, substring, replace, case-independent
  20767.      
  20768.      key sentence:   replaces, in a string, the first case-independent
  20769.                      occurrence of one substring with another substring
  20770.      
  20771.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  20772.                                      strsubrpl< {i} | {i}all >{new}
  20773.      
  20774.      usage example:  compiled/executed/verified on 12/16/92
  20775.      
  20776.                      char Astring[80] = "this that and the other that was";
  20777.                      strsubrpli(Astring, "THAT", "those");
  20778.                      printf("\n%s", Astring);
  20779.                      printf("\n%s", strsubrpli(Astring, "AND the", "which"));
  20780.                      printf("\n%s", Astring);
  20781.      
  20782.                      this those and the other that was
  20783.                       other that was
  20784.                      this those which other that was
  20785.      
  20786.                               ┌───────────────────────┐
  20787.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  20788.                               └───────────────────────┘                      */
  20789.  
  20790.  
  20791.  
  20792.  
  20793.  
  20794.  
  20795.  
  20796.      page 334            The Hobbit House String Library
  20797.  
  20798.  
  20799.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20800.      ║ SUBRPIA.C    ║   file date: 03/13/93    page   1 of   2 ║ SUBRPIA.C    ║
  20801.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20802.  
  20803.      /*                       ┌───────────────────────┐           strsubrpliall
  20804.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  20805.                               └───────────────────────┘
  20806.                                copyright(c) 1992, 1993
  20807.      
  20808.      function:       strsubrpliall (STRing, SUBstring RePLace, case-
  20809.                                     Independant, ALL occurrences)
  20810.      
  20811.      KWIC:           %replace %all occurrences, %independent of case, of one
  20812.                      %substring with another
  20813.      
  20814.      syntax:         #include "hhstring.h"
  20815.                      int strsubrpliall(char *instring, char *fromstr,
  20816.                                        char *tostr)
  20817.      
  20818.      
  20819.      description:    all occurrences of fromstr in instring, independent of
  20820.                      case, are replaced with tostr
  20821.      
  20822.      returns:        The number of times fromstr was found and replaced. If
  20823.                      fromstr doesn't occur in instring, then the return is 0.
  20824.      
  20825.      comments:       if tostr is larger that fromstr, then instring must be
  20826.                      large enough to accommodate the extra characters, else
  20827.                      there be dragons
  20828.      
  20829.                      The implementation starts each replace operation where
  20830.                      the last one left off, both for efficiency and so that
  20831.                      if tostr and fromstr are the same, function will not
  20832.                      hang up in an endless loop. This also has an impact on
  20833.                      how the function deals with situations where the
  20834.                      insertion of the substring creates a new occurrence of
  20835.                      fromstr. To wit: the result of
  20836.      
  20837.                              char Astring[80] = "the one one";
  20838.                              strsubrplall(Astring, "the one", "one the");
  20839.      
  20840.                      is "one the one", not "one one the"
  20841.      
  20842.      keywords:       string, substring, replace, all, case-independent
  20843.      
  20844.      key sentence:   replaces, in a string, all case-independent occurrences of
  20845.                      a substring with another substring
  20846.      
  20847.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  20848.                                      strsubrpl< {i} | {i}all >{new}
  20849.      
  20850.  
  20851.  
  20852.  
  20853.  
  20854.  
  20855.  
  20856.  
  20857.                          The Hobbit House String Library               page 335
  20858.  
  20859.  
  20860.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20861.      ║ SUBRPIA.C    ║   file date: 03/13/93    page   2 of   2 ║ SUBRPIA.C    ║
  20862.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20863.  
  20864.      
  20865.      
  20866.      usage example:  compiled/executed/verified on 12/20/92
  20867.      
  20868.                      char Astring[80] = "This one, that one, the other one";
  20869.                      int num;
  20870.                      num = strsubrpliall(Astring, "ONE", "thing");
  20871.                      printf("\n%d: %s", num, Astring);
  20872.                      num = strsubrpliall(Astring, "th", "/");
  20873.                      printf("\n%d: %s", num, Astring);
  20874.      
  20875.                      3: This thing, that thing, the other thing
  20876.                      7: /is /ing, /at /ing, /e o/er /ing
  20877.      
  20878.                               ┌───────────────────────┐
  20879.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  20880.                               └───────────────────────┘                      */
  20881.  
  20882.  
  20883.  
  20884.  
  20885.  
  20886.  
  20887.  
  20888.  
  20889.  
  20890.  
  20891.  
  20892.  
  20893.  
  20894.  
  20895.  
  20896.  
  20897.  
  20898.  
  20899.  
  20900.  
  20901.  
  20902.  
  20903.  
  20904.  
  20905.  
  20906.  
  20907.  
  20908.  
  20909.  
  20910.  
  20911.  
  20912.  
  20913.  
  20914.  
  20915.  
  20916.  
  20917.  
  20918.      page 336            The Hobbit House String Library
  20919.  
  20920.  
  20921.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20922.      ║ SUBRPIAW.C   ║   file date: 03/13/93    page   1 of   2 ║ SUBRPIAW.C   ║
  20923.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20924.  
  20925.      /*                       ┌───────────────────────┐        strsubrpliallnew
  20926.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  20927.                               └───────────────────────┘
  20928.                                copyright(c) 1992, 1993
  20929.      
  20930.      function:       strsubrpliallnew (STRing, SUBstring RePLace, case-
  20931.                                        Independant, ALL occurrences to NEW)
  20932.      
  20933.      KWIC:           %replace %all occurrences, %independant of case, of one
  20934.                      %substring with another
  20935.      
  20936.      syntax:         #include "hhstring.h"
  20937.                      int strsubrpliallnew(char *newstring, char *instring,
  20938.                                           char *fromstr, char *tostr)
  20939.      
  20940.      description:    all occurrences of fromstr in instring, independent of
  20941.                      case, are replaced with tostr with the result going to
  20942.                      newstring, not to instring. If there are no occurrences,
  20943.                      instring is just copied to newstring.
  20944.      
  20945.      returns:        The number of times fromstr was found and replaced. If
  20946.                      fromstr doesn't occur in instring, then the return is 0.
  20947.      
  20948.      comments:       Because of the implementation technique used, newstring
  20949.                                                                            must
  20950.                      be at least as large as instring, and if tostr is larger
  20951.                                                                            than
  20952.                      fromstr, then newstring must be large enough to
  20953.                                                                     accommodate
  20954.                      the additional characters as well.
  20955.      
  20956.      keywords:       string, substring, replace, all, new, case-independent
  20957.      
  20958.      key sentence:   replaces, in a string, all case-independent occurrences of
  20959.                      one substring with another substring and puts the result
  20960.                      into a new string
  20961.      
  20962.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  20963.                                      strsubrpl< {i} | {i}all >{new}
  20964.      
  20965.      usage example:  compiled/executed/verified on 12/20/92
  20966.      
  20967.                      char Astring[80] = "This one, that one, the other one";
  20968.                      char Bstring[80];
  20969.                      int num;
  20970.                      num = strsubrpliallnew(Bstring, Astring, "one", "thing");
  20971.                      printf("\n%d: %s", num, Bstring);
  20972.                      num = strsubrpliallnew(Astring, Bstring, "th", "/");
  20973.                      printf("\n%d: %s", num, Astring);
  20974.      
  20975.                      3: This thing, that thing, the other thing
  20976.                      7: /is /ing, /at /ing, /e o/er /ing
  20977.      
  20978.  
  20979.                          The Hobbit House String Library               page 337
  20980.  
  20981.  
  20982.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  20983.      ║ SUBRPIAW.C   ║   file date: 03/13/93    page   2 of   2 ║ SUBRPIAW.C   ║
  20984.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  20985.  
  20986.                               ┌───────────────────────┐
  20987.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  20988.                               └───────────────────────┘                      */
  20989.  
  20990.  
  20991.  
  20992.  
  20993.  
  20994.  
  20995.  
  20996.  
  20997.  
  20998.  
  20999.  
  21000.  
  21001.  
  21002.  
  21003.  
  21004.  
  21005.  
  21006.  
  21007.  
  21008.  
  21009.  
  21010.  
  21011.  
  21012.  
  21013.  
  21014.  
  21015.  
  21016.  
  21017.  
  21018.  
  21019.  
  21020.  
  21021.  
  21022.  
  21023.  
  21024.  
  21025.  
  21026.  
  21027.  
  21028.  
  21029.  
  21030.  
  21031.  
  21032.  
  21033.  
  21034.  
  21035.  
  21036.  
  21037.  
  21038.  
  21039.  
  21040.      page 338            The Hobbit House String Library
  21041.  
  21042.  
  21043.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21044.      ║ SUBRPIW.C    ║   file date: 03/13/93    page   1 of   2 ║ SUBRPIW.C    ║
  21045.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21046.  
  21047.      /*                       ┌───────────────────────┐           strsubrplinew
  21048.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  21049.                               └───────────────────────┘
  21050.                                copyright(c) 1992, 1993
  21051.      
  21052.      function:       strsubrplinew (STRing, SUBstring, RePLace, case-
  21053.                                     Independant, to NEW string)
  21054.      
  21055.      KWIC:           %replace an occurrence, %indpendant of case, of one
  21056.                      %substring with another substring
  21057.      
  21058.      syntax:         #include "hhstring.h"
  21059.                      char *strsubrplinew (char *newstring, char *instring,
  21060.                                           char *oldsub, char *newsub)
  21061.      
  21062.      description:    all case-independent occurrences of oldsub in instring
  21063.                      are replaced with newsub, with the result going to
  21064.                      newstring
  21065.      
  21066.      returns:        pointer to the character in the modified instring which
  21067.                      follows the inserted newsub. If oldsub doesn't occur in
  21068.                      instring, then the return is a NULL.
  21069.      
  21070.      comments:       Because of the implementation technique used, newstring
  21071.                                                                            must
  21072.                      be at least as large as instring, and if tostr is larger
  21073.                                                                            than
  21074.                      fromstr, then newstring must be large enough to
  21075.                                                                     accommodate
  21076.                      the additional characters as well.
  21077.      
  21078.      keywords:       string, substring, replace, new, case-independent
  21079.      
  21080.      key sentence:   replaces, in a string, all case-independent occurrences of
  21081.                      a substring with another substring and puts the result
  21082.                      into a new string
  21083.      
  21084.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  21085.                                      strsubrpl< {i} | {i}all >{new}
  21086.      
  21087.  
  21088.  
  21089.  
  21090.  
  21091.  
  21092.  
  21093.  
  21094.  
  21095.  
  21096.  
  21097.  
  21098.  
  21099.  
  21100.  
  21101.                          The Hobbit House String Library               page 339
  21102.  
  21103.  
  21104.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21105.      ║ SUBRPIW.C    ║   file date: 03/13/93    page   2 of   2 ║ SUBRPIW.C    ║
  21106.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21107.  
  21108.      
  21109.      
  21110.      usage example:  compiled/executed/verified on 12/20/92
  21111.      
  21112.                      char Astring[80] = "this that and the other that was";
  21113.                      char Bstring[80];
  21114.                      char Cstring[80];
  21115.                      strsubrplinew(Bstring, Astring, "THAT", "those");
  21116.                      printf("\n%s", Bstring);
  21117.                      printf("\n%s", strsubrplinew(Cstring, Bstring,
  21118.                                                  "AND the", "which"));
  21119.                      printf("\n%s", Cstring);
  21120.      
  21121.                      this those and the other that was
  21122.                       other that was
  21123.                      this those which other that was
  21124.      
  21125.                               ┌───────────────────────┐
  21126.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  21127.                               └───────────────────────┘                      */
  21128.  
  21129.  
  21130.  
  21131.  
  21132.  
  21133.  
  21134.  
  21135.  
  21136.  
  21137.  
  21138.  
  21139.  
  21140.  
  21141.  
  21142.  
  21143.  
  21144.  
  21145.  
  21146.  
  21147.  
  21148.  
  21149.  
  21150.  
  21151.  
  21152.  
  21153.  
  21154.  
  21155.  
  21156.  
  21157.  
  21158.  
  21159.  
  21160.  
  21161.  
  21162.      page 340            The Hobbit House String Library
  21163.  
  21164.  
  21165.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21166.      ║ SUBRPW.C     ║   file date: 03/13/93    page   1 of   2 ║ SUBRPW.C     ║
  21167.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21168.  
  21169.      /*                       ┌───────────────────────┐            strsubrplnew
  21170.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  21171.                               └───────────────────────┘
  21172.                                copyright(c) 1992, 1993
  21173.      
  21174.      function:       strsubrplnew (STRing, SUBstring RePLace, to NEW)
  21175.      
  21176.      KWIC:           %replace one %substring with another
  21177.      
  21178.      syntax:         #include "hhstring.h"
  21179.                      char *strsubrplnew(char *newstring, char *instring,
  21180.                                         char *fromstr, char *tostr)
  21181.      
  21182.      description:    the first occurrence of fromstr in instring is replaced
  21183.                      with tostr, with the result going to newstring. If fromstr
  21184.                      doesn't occur in instring, then newstring is just a copy
  21185.                      of instring.
  21186.      
  21187.      returns:        if the fromstr is found, then the return is a pointer
  21188.                      to the new string, otherwise instring is copied into
  21189.                      newstring, but the return is NULL.
  21190.      
  21191.      comments:       Because of the implementation technique used, newstring
  21192.                                                                            must
  21193.                      be at least as large as instring, and if tostr is larger
  21194.                                                                            than
  21195.                      fromstr, then newstring must be large enough to
  21196.                                                                     accommodate
  21197.                      the additional characters as well.
  21198.      
  21199.      keywords:       string, substring, replace, new
  21200.      
  21201.      key sentence:   replaces, in a string, the first occurrence of one
  21202.                      substring with another substring and puts the results
  21203.                      into a new string
  21204.      
  21205.      see also:       strsubcount{i}  strsubdel< {i} | {i}all >{new}
  21206.                                      strsubrpl< {i} | {i}all >{new}
  21207.      
  21208.  
  21209.  
  21210.  
  21211.  
  21212.  
  21213.  
  21214.  
  21215.  
  21216.  
  21217.  
  21218.  
  21219.  
  21220.  
  21221.  
  21222.  
  21223.                          The Hobbit House String Library               page 341
  21224.  
  21225.  
  21226.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21227.      ║ SUBRPW.C     ║   file date: 03/13/93    page   2 of   2 ║ SUBRPW.C     ║
  21228.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21229.  
  21230.      
  21231.      
  21232.      usage example:  compiled/executed/verified on 12/20/92
  21233.      
  21234.                      char Astring[80] = "this that and the other that was";
  21235.                      char Bstring[80];
  21236.                      char Cstring[80];
  21237.                      strsubrplnew(Bstring, Astring, "that", "those");
  21238.                      printf("\n%s", Bstring);
  21239.                      printf("\n%s", strsubrplnew(Cstring, Bstring,
  21240.                                              "and the", "which"));
  21241.                      printf("\n%s", strsubrplnew(Bstring, Astring,
  21242.                                              "not there", "none"));
  21243.      
  21244.                      this those and the other that was
  21245.                      this those which other that was
  21246.                      (null)
  21247.      
  21248.                               ┌───────────────────────┐
  21249.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  21250.                               └───────────────────────┘                      */
  21251.  
  21252.  
  21253.  
  21254.  
  21255.  
  21256.  
  21257.  
  21258.  
  21259.  
  21260.  
  21261.  
  21262.  
  21263.  
  21264.  
  21265.  
  21266.  
  21267.  
  21268.  
  21269.  
  21270.  
  21271.  
  21272.  
  21273.  
  21274.  
  21275.  
  21276.  
  21277.  
  21278.  
  21279.  
  21280.  
  21281.  
  21282.  
  21283.  
  21284.      page 342            The Hobbit House String Library
  21285.  
  21286.  
  21287.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21288.      ║ TAB2BLK.C    ║   file date: 03/13/93    page   1 of   2 ║ TAB2BLK.C    ║
  21289.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21290.  
  21291.      /*                       ┌───────────────────────┐           strtabtoblank
  21292.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  21293.                               └───────────────────────┘
  21294.                                copyright(c) 1992, 1993
  21295.      
  21296.      function:       strtabtoblank (STRing TAB TO BLANK expansion)
  21297.      
  21298.      KWIC:           %expand %TABs to %blanks
  21299.      
  21300.      syntax:         #include "hhstring.h"
  21301.                      char *strtabtoblank(char *inpline, int tabspace)
  21302.      
  21303.      description:    tabs are expanded to every "tabspace" characters. If
  21304.                      tabspace is zero or if the string is more than 256
  21305.                      characters long, then the string remains unmodified.
  21306.      
  21307.      returns:        a pointer to the string
  21308.      
  21309.      comments:       the required memory space must be available in inpline
  21310.                                                                            else
  21311.                      memory contents beyond inpline will be destroyed.
  21312.      
  21313.                      The string pointed to by the return value of this function
  21314.                      is in the calling function's space. The return value is
  21315.                      provided as a convenience, not a necessity.
  21316.      
  21317.      keywords:       string, blank, tab, convert
  21318.      
  21319.      key sentence:   expands tabs to blanks using a specified tab space
  21320.                                                                      (including
  21321.                      strings inside quotes, so be careful)
  21322.      
  21323.      see also:       strtabtoblank   strblanktotab
  21324.      
  21325.      usage example:  compiled/executed/verified on 2/21/93
  21326.      
  21327.                      char Astring[80];
  21328.      
  21329.                      strcpy(Astring, "This is \tthe \tsample line");
  21330.                      strtabtoblank(Astring, 8);
  21331.                      printf("\n12345678123456781234567812345678");
  21332.                      printf("\n%s", Astring);
  21333.      
  21334.                      strcpy(Astring, "This is \tthe \tsample line");
  21335.                      strtabtoblank(Astring, 4);
  21336.                      printf("\n\n12341234123412341234123412341234");
  21337.                      printf("\n%s", Astring);
  21338.      
  21339.  
  21340.  
  21341.  
  21342.  
  21343.  
  21344.  
  21345.                          The Hobbit House String Library               page 343
  21346.  
  21347.  
  21348.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21349.      ║ TAB2BLK.C    ║   file date: 03/13/93    page   2 of   2 ║ TAB2BLK.C    ║
  21350.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21351.  
  21352.      
  21353.                      12345678123456781234567812345678
  21354.                      This is         the     sample line";
  21355.      
  21356.                      12341234123412341234123412341234
  21357.                      This is     the     sample line";
  21358.      
  21359.                               ┌───────────────────────┐
  21360.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  21361.                               └───────────────────────┘                      */
  21362.  
  21363.  
  21364.  
  21365.  
  21366.  
  21367.  
  21368.  
  21369.  
  21370.  
  21371.  
  21372.  
  21373.  
  21374.  
  21375.  
  21376.  
  21377.  
  21378.  
  21379.  
  21380.  
  21381.  
  21382.  
  21383.  
  21384.  
  21385.  
  21386.  
  21387.  
  21388.  
  21389.  
  21390.  
  21391.  
  21392.  
  21393.  
  21394.  
  21395.  
  21396.  
  21397.  
  21398.  
  21399.  
  21400.  
  21401.  
  21402.  
  21403.  
  21404.  
  21405.  
  21406.      page 344            The Hobbit House String Library
  21407.  
  21408.  
  21409.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21410.      ║ TEXTFIR.C    ║   file date: 03/13/93    page   1 of   2 ║ TEXTFIR.C    ║
  21411.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21412.  
  21413.      /*                       ┌───────────────────────┐            strtextfirst
  21414.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  21415.                               └───────────────────────┘
  21416.                                copyright(c) 1992, 1993
  21417.      
  21418.      function:       strtextfirst (STRing, get TEXT, FIRST)
  21419.      
  21420.      KWIC:           %get the %first %text word in a string
  21421.      
  21422.      syntax:         #include "hhstring.h"
  21423.                      char *strtextfirst(char *firsttext, char *instring)
  21424.      
  21425.      description:    the first text word in instring is copied into firsttext
  21426.      
  21427.      returns:        a pointer to firsttext or NULL if there isn't a text word
  21428.      
  21429.      comments:       a "text word" is a grammatical, or linguistic construct
  21430.                      as opposed to a "word" which is simply a conglomeration
  21431.                      of characters. Actually, the only distinction made by
  21432.                      this function library is in the terminator. "Words" are
  21433.                      terminated by a blank, a tab, an ASCII End-Of-Line (EOL)
  21434.                      or an End-Of-String (EOS). "Text words", however may also
  21435.                      be terminated by any of these punctuation marks: .!?:;,
  21436.      
  21437.                      leading blanks and tabs will be skipped in the search for
  21438.                      the first text word.
  21439.      
  21440.                      The string pointed to by the return value of this function
  21441.                      is in the calling function's space. The return value is
  21442.                      provided as a convenience, not a necessity.
  21443.      
  21444.      keywords:       string, text, word, first
  21445.      
  21446.      key sentence:   copies the first text word in a string to another string
  21447.      
  21448.      see also:       strtext< first | get | last | next | prev | this >
  21449.      
  21450.  
  21451.  
  21452.  
  21453.  
  21454.  
  21455.  
  21456.  
  21457.  
  21458.  
  21459.  
  21460.  
  21461.  
  21462.  
  21463.  
  21464.  
  21465.  
  21466.  
  21467.                          The Hobbit House String Library               page 345
  21468.  
  21469.  
  21470.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21471.      ║ TEXTFIR.C    ║   file date: 03/13/93    page   2 of   2 ║ TEXTFIR.C    ║
  21472.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21473.  
  21474.      
  21475.      
  21476.      usage example:  compiled/executed/verified on 2/21/93
  21477.      
  21478.                      char *Astring = "   not this; ";
  21479.                      char *Bstring = "ended. And then";
  21480.                      char Cstring[80];
  21481.                      strtextfirst(Cstring, Astring);
  21482.                      printf("\n%s", Cstring);
  21483.                      printf("\n%s", strtextfirst(Cstring, Bstring));
  21484.                      printf("\n%s", strtextfirst(Cstring, " \n\f\t  "));
  21485.      
  21486.                      not
  21487.                      ended
  21488.                      (null)
  21489.      
  21490.                               ┌───────────────────────┐
  21491.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  21492.                               └───────────────────────┘                      */
  21493.  
  21494.  
  21495.  
  21496.  
  21497.  
  21498.  
  21499.  
  21500.  
  21501.  
  21502.  
  21503.  
  21504.  
  21505.  
  21506.  
  21507.  
  21508.  
  21509.  
  21510.  
  21511.  
  21512.  
  21513.  
  21514.  
  21515.  
  21516.  
  21517.  
  21518.  
  21519.  
  21520.  
  21521.  
  21522.  
  21523.  
  21524.  
  21525.  
  21526.  
  21527.  
  21528.      page 346            The Hobbit House String Library
  21529.  
  21530.  
  21531.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21532.      ║ TEXTGET.C    ║   file date: 03/13/93    page   1 of   2 ║ TEXTGET.C    ║
  21533.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21534.  
  21535.      /*                       ┌───────────────────────┐              strtextget
  21536.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  21537.                               └───────────────────────┘
  21538.                                copyright(c) 1992, 1993
  21539.      
  21540.      function:       strtextget (STRing TEXT GET)
  21541.      
  21542.      KWIC:           %get the %text word starting at a given pointer
  21543.      
  21544.      syntax:         #include "hhstring.h"
  21545.                      char *strtextget(char *text, char *ptr)
  21546.      
  21547.      description:    the text word pointed to by ptr is transferred to text,
  21548.                      one character at a time, until a text terminator is found,
  21549.                      at which point text is terminated.
  21550.      
  21551.      returns:        a pointer to text
  21552.      
  21553.      comments:       a "text word" is a grammatical, or linguistic construct
  21554.                      as opposed to a "word" which is simply a conglomeration
  21555.                      of characters. Actually, the only distinction made by
  21556.                      this function library is in the terminator. "Words" are
  21557.                      terminated by a blank, a tab, an ASCII End-Of-Line (EOL)
  21558.                      or an End-Of-String (EOS). "Text words", however may also
  21559.                      be terminated by any of these punctuation marks: .!?:;,
  21560.      
  21561.      
  21562.                      This is primarily a support function for use by the other
  21563.                      text functions listed below in "see also".
  21564.      
  21565.                      Unlike strtextthis, strtextget does NOT scan backwards
  21566.                      looking for the beginning of a text. It takes the pointer
  21567.                      that it is given as the beginning of the desired text.
  21568.      
  21569.                      if the input pointer points to a text terminator, then
  21570.                      text will be set to NULL
  21571.      
  21572.                      The string pointed to by the return value of this function
  21573.                      is in the calling function's space. The return value is
  21574.                      provided as a convenience, not a necessity.
  21575.      
  21576.      keywords:       string, text, word
  21577.      
  21578.      key sentence:   copies the text word starting at a given pointer into a
  21579.                      specified string
  21580.      
  21581.      see also:       strtext< first | get | last | next | prev | this >
  21582.      
  21583.  
  21584.  
  21585.  
  21586.  
  21587.  
  21588.  
  21589.                          The Hobbit House String Library               page 347
  21590.  
  21591.  
  21592.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21593.      ║ TEXTGET.C    ║   file date: 03/13/93    page   2 of   2 ║ TEXTGET.C    ║
  21594.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21595.  
  21596.      
  21597.      
  21598.      usage example:  compiled/executed/verified on 1/15/93
  21599.      
  21600.                      char *string = "this. And then";
  21601.                      char text[80];
  21602.                      strtextget(text, string);
  21603.                      printf("\n%s", text);
  21604.                      printf("\n%s", strtextget(text, string + 1));
  21605.                      printf("\n%s", strtextget(text, string + 5));
  21606.      
  21607.                      this
  21608.                      his
  21609.                      (null)
  21610.      
  21611.                               ┌───────────────────────┐
  21612.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  21613.                               └───────────────────────┘                      */
  21614.  
  21615.  
  21616.  
  21617.  
  21618.  
  21619.  
  21620.  
  21621.  
  21622.  
  21623.  
  21624.  
  21625.  
  21626.  
  21627.  
  21628.  
  21629.  
  21630.  
  21631.  
  21632.  
  21633.  
  21634.  
  21635.  
  21636.  
  21637.  
  21638.  
  21639.  
  21640.  
  21641.  
  21642.  
  21643.  
  21644.  
  21645.  
  21646.  
  21647.  
  21648.  
  21649.  
  21650.      page 348            The Hobbit House String Library
  21651.  
  21652.  
  21653.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21654.      ║ TEXTLAST.C   ║   file date: 03/13/93    page   1 of   2 ║ TEXTLAST.C   ║
  21655.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21656.  
  21657.      /*                       ┌───────────────────────┐             strtextlast
  21658.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  21659.                               └───────────────────────┘
  21660.                                copyright(c) 1992, 1993
  21661.      
  21662.      function:       strtextlast (STRing, get TEXT, LAST)
  21663.      
  21664.      KWIC:           %get the %last %text word in a string
  21665.      
  21666.      syntax:         #include "hhstring.h"
  21667.                      char *strtextlast(char *lasttext, char *instring)
  21668.      
  21669.      description:    the last text word in instring is copied to lasttext.
  21670.                      Trailing text terminators are ignored.
  21671.      
  21672.      returns:        a pointer to lasttext or a NULL of none found
  21673.      
  21674.      comments:       a "text word" is a grammatical, or linguistic construct
  21675.                      as opposed to a "word" which is simply a conglomeration
  21676.                      of characters. Actually, the only distinction made by
  21677.                      this function library is in the terminator. "Words" are
  21678.                      terminated by a blank, a tab, an ASCII End-Of-Line (EOL)
  21679.                      or an End-Of-String (EOS). "Text words", however may also
  21680.                      be terminated by any of these punctuation marks: .!?:;,
  21681.      
  21682.                      The string pointed to by the return value of this function
  21683.                      is in the calling function's space. The return value is
  21684.                      provided as a convenience, not a necessity.
  21685.      
  21686.                      If the string is empty or white, lasttext will be empty
  21687.                      and the return will be NULL
  21688.      
  21689.      keywords:       string, text, word, last
  21690.      
  21691.      key sentence:   copies the last text word in a string to another string
  21692.      
  21693.      see also:       strtext< first | get | last | next | prev | this >
  21694.      
  21695.  
  21696.  
  21697.  
  21698.  
  21699.  
  21700.  
  21701.  
  21702.  
  21703.  
  21704.  
  21705.  
  21706.  
  21707.  
  21708.  
  21709.  
  21710.  
  21711.                          The Hobbit House String Library               page 349
  21712.  
  21713.  
  21714.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21715.      ║ TEXTLAST.C   ║   file date: 03/13/93    page   2 of   2 ║ TEXTLAST.C   ║
  21716.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21717.  
  21718.      
  21719.      
  21720.      usage example:  compiled/executed/verified on 2/21/93
  21721.      
  21722.                      char *Astring = "this is the sample string.\n";
  21723.                      char *Bstring = "and another one: ";
  21724.                      char Cstring[80];
  21725.                      strtextlast(Cstring, Astring);
  21726.                      printf("\n%s", Cstring);
  21727.                      printf("\n%s", strtextlast(Cstring, Bstring));
  21728.                      printf("\n%s", strtextlast(Cstring, "thisone!"));
  21729.                      printf("\n%s", strtextlast(Cstring, " \t.? "));
  21730.                      printf("\n%s", strtextlast(Cstring, ""));
  21731.      
  21732.                      string
  21733.                      one
  21734.                      thisone
  21735.                      (null)
  21736.                      (null)
  21737.      
  21738.                               ┌───────────────────────┐
  21739.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  21740.                               └───────────────────────┘                      */
  21741.  
  21742.  
  21743.  
  21744.  
  21745.  
  21746.  
  21747.  
  21748.  
  21749.  
  21750.  
  21751.  
  21752.  
  21753.  
  21754.  
  21755.  
  21756.  
  21757.  
  21758.  
  21759.  
  21760.  
  21761.  
  21762.  
  21763.  
  21764.  
  21765.  
  21766.  
  21767.  
  21768.  
  21769.  
  21770.  
  21771.  
  21772.      page 350            The Hobbit House String Library
  21773.  
  21774.  
  21775.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21776.      ║ TEXTNEXT.C   ║   file date: 03/13/93    page   1 of   2 ║ TEXTNEXT.C   ║
  21777.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21778.  
  21779.      /*                       ┌───────────────────────┐             strtextnext
  21780.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  21781.                               └───────────────────────┘
  21782.                                copyright(c) 1992, 1993
  21783.      
  21784.      function:       strtextnext (STRing, get TEXT word, NEXT)
  21785.      
  21786.      KWIC:           %get the %next %text word in a string
  21787.      
  21788.      syntax:         #include "hhstring.h"
  21789.                      char *strtextnext(char *nexttext, char *ptr)
  21790.      
  21791.      description:    scans from ptr for the next text word terminator (to
  21792.                      assure that the current text, if any, is bypassed) and
  21793.                      then searches for the next non-text-terminator as the
  21794.                      start of the next text. At that point, it begins copying
  21795.                      the characters into nexttext until a text terminator is
  21796.                      encountered, at which point, it terminates nexttext
  21797.      
  21798.                      If EOS is found before a text word is found, nexttext
  21799.                      will be empty and the return will be NULL
  21800.      
  21801.      returns:        a pointer to nexttext or NULL if none found
  21802.      
  21803.      comments:       a "text word" is a grammatical, or linguistic construct
  21804.                      as opposed to a "word" which is simply a conglomeration
  21805.                      of characters. Actually, the only distinction made by
  21806.                      this function library is in the terminator. "Words" are
  21807.                      terminated by a blank, a tab, an ASCII End-Of-Line (EOL)
  21808.                      or an End-Of-String (EOS). "Text words", however may also
  21809.                      be terminated by any of these punctuation marks: .!?:;,
  21810.      
  21811.                      This function handles text words at the end of a line by
  21812.                      dealing with '\n' and '\0' termination characters. This
  21813.                      does mean that if one creates a string with embedded '\n'
  21814.                      characters, this function will terminate before the
  21815.                      string ends. The function is designed to work with lines,
  21816.                      as a text processor (including a human) thinks of lines,
  21817.                      not strings in the more general sense.
  21818.      
  21819.                      The string pointed to by the return value of this function
  21820.                      is in the calling function's space. The return value is
  21821.                      provided as a convenience, not a necessity.
  21822.      
  21823.      keywords:       string, text, word, next
  21824.      
  21825.      key sentence:   copies the next text in a string to another string
  21826.      
  21827.      see also:       strtext< first | get | last | next | prev | this >
  21828.      
  21829.  
  21830.  
  21831.  
  21832.  
  21833.                          The Hobbit House String Library               page 351
  21834.  
  21835.  
  21836.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21837.      ║ TEXTNEXT.C   ║   file date: 03/13/93    page   2 of   2 ║ TEXTNEXT.C   ║
  21838.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21839.  
  21840.      
  21841.      
  21842.      usage example:  compiled/executed/verified on 2/21/93
  21843.      
  21844.                      char *line = "not this, he said!";
  21845.                      char Next[20];
  21846.                      strtextnext(Next, line);
  21847.                      printf("\n%s", Next);
  21848.                      printf("\n%s", strtextnext(Next, line + 12));
  21849.                      printf("\n%s", strtextnext(Next, line + 13));
  21850.                      printf("\n%s", strtextnext(Next, "   \t   "));
  21851.                      printf("\n%s", strtextnext(Next, "thisword"));
  21852.                      printf("\n%s", strtextnext(Next, ""));
  21853.      
  21854.                      this
  21855.                      said
  21856.                      (null)
  21857.                      (null)
  21858.                      (null)
  21859.                      (null)
  21860.      
  21861.                               ┌───────────────────────┐
  21862.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  21863.                               └───────────────────────┘                      */
  21864.  
  21865.  
  21866.  
  21867.  
  21868.  
  21869.  
  21870.  
  21871.  
  21872.  
  21873.  
  21874.  
  21875.  
  21876.  
  21877.  
  21878.  
  21879.  
  21880.  
  21881.  
  21882.  
  21883.  
  21884.  
  21885.  
  21886.  
  21887.  
  21888.  
  21889.  
  21890.  
  21891.  
  21892.  
  21893.  
  21894.      page 352            The Hobbit House String Library
  21895.  
  21896.  
  21897.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21898.      ║ TEXTPREV.C   ║   file date: 03/13/93    page   1 of   2 ║ TEXTPREV.C   ║
  21899.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21900.  
  21901.      /*                       ┌───────────────────────┐             strtextprev
  21902.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  21903.                               └───────────────────────┘
  21904.                                copyright(c) 1992, 1993
  21905.      
  21906.      function:       strtextprev (STRing, get TEXT, PREVious)
  21907.      
  21908.      KWIC:           %get the %previous %text word from a given pointer
  21909.      
  21910.      syntax:         #include "hhstring.h"
  21911.                      char *strtextprev(char *prevtext, char *ptr)
  21912.      
  21913.      description:    scans backwards from ptr for whitespace, then scans
  21914.                      backward for non-whitespace and non-text-word-terminators,
  21915.                      then scans backward for whitespace again and returns the
  21916.                      text word following that whitespace. Think of it this way;
  21917.                      given a pointer to any point in a sentence, this function
  21918.                      returns the text word preceding the one pointed to. If
  21919.                      the pointer points at a word terminator or a text word
  21920.                      terminator, this function returns the text word which
  21921.                      precedes the whitespace or text word terminator.
  21922.      
  21923.      returns:        a pointer to prevtext
  21924.      
  21925.      comments:       a "text word" is a grammatical, or linguistic construct
  21926.                      as opposed to a "word" which is simply a conglomeration
  21927.                      of characters. Actually, the only distinction made by
  21928.                      this function library is in the terminator. "Words" are
  21929.                      terminated by a blank, a tab, an ASCII End-Of-Line (EOL)
  21930.                      or an End-Of-String (EOS). "Text words", however may also
  21931.                      be terminated by any of these punctuation marks: .!?:;,
  21932.      
  21933.      
  21934.                      If the input pointer points to the first text word in a
  21935.                      string, prevtext will NOT be that text word but will be
  21936.                      that text word preceded by all of the characters which
  21937.                      precede it in memory up to and including the previous
  21938.                      text word. Be careful!
  21939.      
  21940.                      The string pointed to by the return value of this function
  21941.                      is in the calling function's space. The return value is
  21942.                      provided as a convenience, not a necessity.
  21943.      
  21944.      keywords:       string, text, word, previous
  21945.      
  21946.      key sentence:   copies the text word found previous to a given pointer
  21947.                      into a specified string
  21948.      
  21949.      see also:       strtext< first | get | last | next | prev | this >
  21950.      
  21951.  
  21952.  
  21953.  
  21954.  
  21955.                          The Hobbit House String Library               page 353
  21956.  
  21957.  
  21958.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  21959.      ║ TEXTPREV.C   ║   file date: 03/13/93    page   2 of   2 ║ TEXTPREV.C   ║
  21960.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  21961.  
  21962.      
  21963.      
  21964.      usage example:  compiled/executed/verified on 2/9/93
  21965.      
  21966.                      char *stringptr = "  ended? And so on.";
  21967.                      char prevtext[80];
  21968.                      strtextprev(prevtext, stringptr+11);
  21969.                      printf("\n%s", prevtext);
  21970.                      printf("\n%s", strtextprev(prevtext, stringptr+8));
  21971.                      printf("\n%s", strtextprev(prevtext, " this,  .  " + 9));
  21972.      
  21973.                      ended
  21974.                      ended
  21975.                      this
  21976.      
  21977.                               ┌───────────────────────┐
  21978.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  21979.                               └───────────────────────┘                      */
  21980.  
  21981.  
  21982.  
  21983.  
  21984.  
  21985.  
  21986.  
  21987.  
  21988.  
  21989.  
  21990.  
  21991.  
  21992.  
  21993.  
  21994.  
  21995.  
  21996.  
  21997.  
  21998.  
  21999.  
  22000.  
  22001.  
  22002.  
  22003.  
  22004.  
  22005.  
  22006.  
  22007.  
  22008.  
  22009.  
  22010.  
  22011.  
  22012.  
  22013.  
  22014.  
  22015.  
  22016.      page 354            The Hobbit House String Library
  22017.  
  22018.  
  22019.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22020.      ║ TEXTTHIS.C   ║   file date: 03/13/93    page   1 of   2 ║ TEXTTHIS.C   ║
  22021.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22022.  
  22023.      /*                       ┌───────────────────────┐             strtextthis
  22024.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  22025.                               └───────────────────────┘
  22026.                                copyright(c) 1992, 1993
  22027.      
  22028.      function:       strtextthis (STRing, get TEXT, THIS)
  22029.      
  22030.      KWIC:           %get %this %text word (regardless of what character in the
  22031.                      word is pointed to)
  22032.      
  22033.      syntax:         #include "hhstring.h"
  22034.                      char *strtextthis(char *thistext, char *inptr)
  22035.      
  22036.      description:    scans backward from inptr until whitespace is encountered
  22037.                      and then moves the text word following the whitespace into
  22038.                      thistext. If the input pointer points at a word terminator
  22039.                      or a text terminator, then thistext will be NULL.
  22040.      
  22041.      returns:        a pointer to thistext
  22042.      
  22043.      comments:       a "text word" is a grammatical, or linguistic construct
  22044.                      as opposed to a "word" which is simply a conglomeration
  22045.                      of characters. Actually, the only distinction made by
  22046.                      this function library is in the terminator. "Words" are
  22047.                      terminated by a blank, a tab, an ASCII End-Of-Line (EOL)
  22048.                      or an End-Of-String (EOS). "Text words", however may also
  22049.                      be terminated by any of these punctuation marks: .!?:;,
  22050.      
  22051.      
  22052.                      If the input pointer points to the first text word in a
  22053.                      string, thistext will NOT be that text word but will be
  22054.                      that text word preceded by all of the characters which
  22055.                      precede it in memory up to and including the previous
  22056.                      text word. Be careful!
  22057.      
  22058.                      The string pointed to by the return value of this function
  22059.                      is in the calling function's space. The return value is
  22060.                      provided as a convenience, not a necessity.
  22061.      
  22062.      keywords:       string, text, word, this
  22063.      
  22064.      key sentence:   copies the text word pointed to, regardless of what
  22065.                      character in the word is pointed to, to another string
  22066.      
  22067.      see also:       strtext< first | get | last | next | prev | this >
  22068.      
  22069.  
  22070.  
  22071.  
  22072.  
  22073.  
  22074.  
  22075.  
  22076.  
  22077.                          The Hobbit House String Library               page 355
  22078.  
  22079.  
  22080.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22081.      ║ TEXTTHIS.C   ║   file date: 03/13/93    page   2 of   2 ║ TEXTTHIS.C   ║
  22082.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22083.  
  22084.      
  22085.      
  22086.      usage example:  compiled/executed/verified on 2/21/93
  22087.      
  22088.                      char *string = "And.so.on. Then";
  22089.                      char thistext[80];
  22090.                      strtextthis(thistext, string+7);
  22091.                      printf("\n%s", thistext);
  22092.                      printf("\n%s", strtextthis(thistext, string+4));
  22093.                      printf("\n%s", strtextthis(thistext, string+3));
  22094.      
  22095.                      on
  22096.                      so
  22097.                      (null)
  22098.      
  22099.                               ┌───────────────────────┐
  22100.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  22101.                               └───────────────────────┘                      */
  22102.  
  22103.  
  22104.  
  22105.  
  22106.  
  22107.  
  22108.  
  22109.  
  22110.  
  22111.  
  22112.  
  22113.  
  22114.  
  22115.  
  22116.  
  22117.  
  22118.  
  22119.  
  22120.  
  22121.  
  22122.  
  22123.  
  22124.  
  22125.  
  22126.  
  22127.  
  22128.  
  22129.  
  22130.  
  22131.  
  22132.  
  22133.  
  22134.  
  22135.  
  22136.  
  22137.  
  22138.      page 356            The Hobbit House String Library
  22139.  
  22140.  
  22141.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22142.      ║ TOC.C        ║   file date: 03/13/93    page   1 of   1 ║ TOC.C        ║
  22143.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22144.  
  22145.      /*                       ┌───────────────────────┐                  strtoc
  22146.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  22147.                               └───────────────────────┘
  22148.                                copyright(c) 1992, 1993
  22149.      
  22150.      function:       strtoc (STRing TO C format)
  22151.      
  22152.      KWIC:           %convert a string to %C-sequence format
  22153.      
  22154.      syntax:         #include "hhstring.h"
  22155.                      char *strtoc(char *tostring, char *instring)
  22156.      
  22157.      description:    converts a string to a form which uses the C language
  22158.                      standard for representing certain special characters. A
  22159.                      complete list of these characters is given with the
  22160.                      function strchrtoc (which is the function that actually
  22161.                      does most of the work for this function). Normal
  22162.                                                                      characters
  22163.                      are not changed
  22164.      
  22165.      returns:        a pointer to the destination string, which has been
  22166.                      filled with the converted string.
  22167.      
  22168.      comments:       note that characters requiring numerical conversion
  22169.                      are be put in the hex format in output string.
  22170.      
  22171.      keywords:       string, convert, C-sequence
  22172.      
  22173.      key sentence:   converts a string to C-sequence format
  22174.      
  22175.      see also:       str{chr}<to | from>c
  22176.      
  22177.      usage example:  compiled/executed/verified on 12/13/92
  22178.      
  22179.                      char str[80] = "a\5\t\142";
  22180.                      char dst[80];
  22181.                      printf("%s", strtoc(dst, str));
  22182.      
  22183.                      a\x05\tb
  22184.                               ┌───────────────────────┐
  22185.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  22186.                               └───────────────────────┘                      */
  22187.  
  22188.  
  22189.  
  22190.  
  22191.  
  22192.  
  22193.  
  22194.  
  22195.  
  22196.  
  22197.  
  22198.  
  22199.                          The Hobbit House String Library               page 357
  22200.  
  22201.  
  22202.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22203.      ║ TOLOWER.C    ║   file date: 03/13/93    page   1 of   1 ║ TOLOWER.C    ║
  22204.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22205.  
  22206.      /*                       ┌───────────────────────┐              strtolower
  22207.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  22208.                               └───────────────────────┘
  22209.                                copyright(c) 1992, 1993
  22210.      
  22211.      function:       strtolower (STRing TO LOWER case)
  22212.      
  22213.      KWIC:           %convert all upper %case letters in a string to lower case
  22214.      
  22215.      syntax:         #include "hhstring.h"
  22216.                      char *strtolower(char *instring)
  22217.      
  22218.      description:    all of the upper case letters in the input string are
  22219.                      converted to lower case
  22220.      
  22221.      returns:        a pointer to the string
  22222.      
  22223.      comments:       The string pointed to by the return value of this function
  22224.                      is in the calling function's space. The return value is
  22225.                      provided as a convenience, not a necessity.
  22226.      
  22227.      keywords:       string, convert, case
  22228.      
  22229.      key sentence:   converts all upper case letters in a string to lower case
  22230.      
  22231.      see also:       strtolower{new}         strtoupper{new}
  22232.      
  22233.      usage example:  compiled/executed/verified on 12/13/92
  22234.      
  22235.                      char *Astring = "STRing TO all LOWER case letters";
  22236.                      strtolower(Astring);
  22237.                      printf("%s", Astring);
  22238.      
  22239.                      string to all lower case letters
  22240.      
  22241.                               ┌───────────────────────┐
  22242.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  22243.                               └───────────────────────┘                      */
  22244.  
  22245.  
  22246.  
  22247.  
  22248.  
  22249.  
  22250.  
  22251.  
  22252.  
  22253.  
  22254.  
  22255.  
  22256.  
  22257.  
  22258.  
  22259.  
  22260.      page 358            The Hobbit House String Library
  22261.  
  22262.  
  22263.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22264.      ║ TOLOWERW.C   ║   file date: 03/13/93    page   1 of   1 ║ TOLOWERW.C   ║
  22265.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22266.  
  22267.      /*                       ┌───────────────────────┐           strtolowernew
  22268.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  22269.                               └───────────────────────┘
  22270.                                copyright(c) 1992, 1993
  22271.      
  22272.      function:       strtolowernew (STRing TO LOWER case to NEW string)
  22273.      
  22274.      KWIC:           %convert all upper %case letters in a string to lower case
  22275.      
  22276.      syntax:         #include "hhstring.h"
  22277.                      char *strtolowernew(char *newstring, char *instring)
  22278.      
  22279.      description:    all of the upper case letters in the input string are
  22280.                      converted to lower case and put into the new string
  22281.      
  22282.      returns:        a pointer to the new string
  22283.      
  22284.      comments:       The string pointed to by the return value of this function
  22285.                      is in the calling function's space. The return value is
  22286.                      provided as a convenience, not a necessity.
  22287.      
  22288.                      Setting newstring = instring will work OK with this
  22289.                      function but overlapping newstring/instring may or may
  22290.                      not work so if you must overlap, do it cautiously.
  22291.      
  22292.      keywords:       string, convert, case, new
  22293.      
  22294.      key sentence:   converts all upper case letters in a string to lower case
  22295.                      and puts the result into a new string
  22296.      
  22297.      see also:       strtolower{new}         strtoupper{new}
  22298.      
  22299.      usage example:  compiled/executed/verified on 12/13/92
  22300.      
  22301.                      char *Astring = "STRing TO all LOWER case letters";
  22302.                      char Bstring[80];
  22303.                      strtolowernew(Bstring, Astring);
  22304.                      printf("%s", Bstring);
  22305.      
  22306.                      string to all lower case letters
  22307.      
  22308.                               ┌───────────────────────┐
  22309.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  22310.                               └───────────────────────┘                      */
  22311.  
  22312.  
  22313.  
  22314.  
  22315.  
  22316.  
  22317.  
  22318.  
  22319.  
  22320.  
  22321.                          The Hobbit House String Library               page 359
  22322.  
  22323.  
  22324.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22325.      ║ TOUPPER.C    ║   file date: 03/13/93    page   1 of   1 ║ TOUPPER.C    ║
  22326.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22327.  
  22328.      /*                       ┌───────────────────────┐              strtoupper
  22329.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  22330.                               └───────────────────────┘
  22331.                                copyright(c) 1992, 1993
  22332.      
  22333.      function:       strtoupper (STRing TO UPPER case)
  22334.      
  22335.      KWIC:           %convert all lower %case letters in a string to upper case
  22336.      
  22337.      syntax:         #include "hhstring.h"
  22338.                      char *strtoupper(char *instring)
  22339.      
  22340.      description:    all of the lower case letters in the input string are
  22341.                      converted to upper case
  22342.      
  22343.      returns:        a pointer to the string
  22344.      
  22345.      comments:       The string pointed to by the return value of this function
  22346.                      is in the calling function's space. The return value is
  22347.                      provided as a convenience, not a necessity.
  22348.      
  22349.      keywords:       string, convert, case
  22350.      
  22351.      key sentence:   converts all lower case letters in a string to upper case
  22352.      
  22353.      see also:       strtolower{new}         strtoupper{new}
  22354.      
  22355.      usage example:  compiled/executed/verified on 12/13/92
  22356.      
  22357.                      char *Astring = "STRing TO all UPPER case letters";
  22358.                      strtoupper(Astring);
  22359.                      printf("%s", Astring);
  22360.      
  22361.                      STRING TO ALL UPPER CASE LETTERS
  22362.      
  22363.                               ┌───────────────────────┐
  22364.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  22365.                               └───────────────────────┘                      */
  22366.  
  22367.  
  22368.  
  22369.  
  22370.  
  22371.  
  22372.  
  22373.  
  22374.  
  22375.  
  22376.  
  22377.  
  22378.  
  22379.  
  22380.  
  22381.  
  22382.      page 360            The Hobbit House String Library
  22383.  
  22384.  
  22385.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22386.      ║ TRIM.C       ║   file date: 03/13/93    page   1 of   1 ║ TRIM.C       ║
  22387.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22388.  
  22389.      /*                       ┌───────────────────────┐                 strtrim
  22390.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  22391.                               └───────────────────────┘
  22392.                                copyright(c) 1992, 1993
  22393.      
  22394.      function:       strtrim (STRing TRIM whitespace)
  22395.      
  22396.      KWIC:           %trim whitespace from both ends of a string
  22397.      
  22398.      syntax:         #include "hhstring.h"
  22399.                      char *strtrim(char *instring)
  22400.      
  22401.      description:    all of the contiguous whitespace (blanks and tabs) is
  22402.                      deleted from both sides of a string. Internal whitespace
  22403.                      is not disturbed.
  22404.      
  22405.      returns:        a pointer to the string
  22406.      
  22407.      comments:       if the string starts off containing nothing but whitespace
  22408.                      then it will end up as a null string
  22409.      
  22410.                      The string pointed to by the return value of this function
  22411.                      is in the calling function's space. The return value is
  22412.                      provided as a convenience, not a necessity.
  22413.      
  22414.      keywords:       string, trim, whitespace, blank, tab
  22415.      
  22416.      key sentence:   trims whitespace (blanks and tabs) from both ends of a
  22417.                      string
  22418.      
  22419.      see also:       strtrim         strlftrim       strrttrim
  22420.                      strtrimnew      strlftrimnew    strrttrimnew
  22421.      
  22422.      usage example:  compiled/executed/verified on 12/13/92
  22423.      
  22424.                      char *Astring = "   3 leading and 3 trailing blanks   ";
  22425.                      strtrim(Astring);
  22426.                      printf("-->%s<--", Astring);
  22427.      
  22428.                      -->3 leading and 3 trailing blanks<--
  22429.      
  22430.                               ┌───────────────────────┐
  22431.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  22432.                               └───────────────────────┘                      */
  22433.  
  22434.  
  22435.  
  22436.  
  22437.  
  22438.  
  22439.  
  22440.  
  22441.  
  22442.  
  22443.                          The Hobbit House String Library               page 361
  22444.  
  22445.  
  22446.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22447.      ║ TRIMW.C      ║   file date: 03/13/93    page   1 of   2 ║ TRIMW.C      ║
  22448.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22449.  
  22450.      /*                       ┌───────────────────────┐              strtrimnew
  22451.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  22452.                               └───────────────────────┘
  22453.                                copyright(c) 1992, 1993
  22454.      
  22455.      function:       strtrimnew (STRing TRIM whitespace to NEW string)
  22456.      
  22457.      KWIC:           %trim %whitespace from both ends of a string
  22458.      
  22459.      syntax:         #include "hhstring.h"
  22460.                      char *strtrimnew(char *newstring, char *instring)
  22461.      
  22462.      description:    creates a string which is identical to a specified string
  22463.                      except that all contiguous whitespace on each end of the
  22464.                      specified string is deleted from the new string
  22465.      
  22466.      returns:        a pointer to the new sting
  22467.      
  22468.      comments:       if the input string contains nothing but whitespace then
  22469.                      the new string will be a null string. Note that this
  22470.                      version requires that the new string have enough room to
  22471.                      take the input string with only the left side trimmed,
  22472.                      since the right side isn't trimmed until after the input
  22473.                      string is put into the new string.
  22474.      
  22475.                      The string pointed to by the return value of this function
  22476.                      is in the calling function's space. The return value is
  22477.                      provided as a convenience, not a necessity.
  22478.      
  22479.                      Setting newstring = instring will work OK with this
  22480.                      function but overlapping newstring/instring may or may
  22481.                      not work so if you must overlap, do it cautiously.
  22482.      
  22483.      keywords:       string, trim, whitespace, blank, tab, new
  22484.      
  22485.      key sentence:   trims whitespace (blanks and tabs) from both ends of a
  22486.                      string and puts the results into a new string
  22487.      
  22488.      see also:       strtrim         strlftrim       strrttrim
  22489.                      strtrimnew      strlftrimnew    strrttrimnew
  22490.      
  22491.  
  22492.  
  22493.  
  22494.  
  22495.  
  22496.  
  22497.  
  22498.  
  22499.  
  22500.  
  22501.  
  22502.  
  22503.  
  22504.      page 362            The Hobbit House String Library
  22505.  
  22506.  
  22507.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22508.      ║ TRIMW.C      ║   file date: 03/13/93    page   2 of   2 ║ TRIMW.C      ║
  22509.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22510.  
  22511.      
  22512.      
  22513.      usage example:  compiled/executed/verified on 12/13/92
  22514.      
  22515.                      char *Astring = "   3 leading and 5 trailing blanks     ";
  22516.                      char Bstring[80];
  22517.                      strtrimnew(Bstring, Astring);
  22518.                      printf("-->%s<--", Bstring);
  22519.      
  22520.                      -->3 leading and 5 trailing blanks<--
  22521.      
  22522.                               ┌───────────────────────┐
  22523.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  22524.                               └───────────────────────┘                      */
  22525.  
  22526.  
  22527.  
  22528.  
  22529.  
  22530.  
  22531.  
  22532.  
  22533.  
  22534.  
  22535.  
  22536.  
  22537.  
  22538.  
  22539.  
  22540.  
  22541.  
  22542.  
  22543.  
  22544.  
  22545.  
  22546.  
  22547.  
  22548.  
  22549.  
  22550.  
  22551.  
  22552.  
  22553.  
  22554.  
  22555.  
  22556.  
  22557.  
  22558.  
  22559.  
  22560.  
  22561.  
  22562.  
  22563.  
  22564.  
  22565.                          The Hobbit House String Library               page 363
  22566.  
  22567.  
  22568.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22569.      ║ WORDFIR.C    ║   file date: 03/13/93    page   1 of   1 ║ WORDFIR.C    ║
  22570.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22571.  
  22572.      /*                       ┌───────────────────────┐            strwordfirst
  22573.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  22574.                               └───────────────────────┘
  22575.                                copyright(c) 1992, 1993
  22576.      
  22577.      function:       strwordfirst (STRing, get WORD, FIRST)
  22578.      
  22579.      KWIC:           %get the %first %word in a string
  22580.      
  22581.      syntax:         #include "hhstring.h"
  22582.                      char *strwordfirst(char *firstword, char *instring)
  22583.      
  22584.      description:    the first word in instring is copied into firstword
  22585.      
  22586.      returns:        a pointer to firstword
  22587.      
  22588.      comments:       leading blanks and tabs will be skipped in the search for
  22589.                      the first word.
  22590.      
  22591.                      The string pointed to by the return value of this function
  22592.                      is in the calling function's space. The return value is
  22593.                      provided as a convenience, not a necessity.
  22594.      
  22595.      keywords:       string, word, first
  22596.      
  22597.      key sentence:   copies the first word in a string to another string
  22598.      
  22599.      see also:       strword< first | get | last | next | prev | this >
  22600.      
  22601.      usage example:  compiled/executed/verified on 2/21/93
  22602.      
  22603.                      char *Astring = "   This is the sample string";
  22604.                      char *Bstring = "That was it";
  22605.                      char Cstring[80];
  22606.                      strwordfirst(Cstring, Astring);
  22607.                      printf("\n%s", Cstring);
  22608.                      printf("\n%s", strwordfirst(Cstring, Bstring));
  22609.                      printf("\n%s", strwordfirst(Cstring, " \t\n\f "));
  22610.      
  22611.                      This
  22612.                      That
  22613.                      (null)
  22614.      
  22615.                               ┌───────────────────────┐
  22616.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  22617.                               └───────────────────────┘                      */
  22618.  
  22619.  
  22620.  
  22621.  
  22622.  
  22623.  
  22624.  
  22625.  
  22626.      page 364            The Hobbit House String Library
  22627.  
  22628.  
  22629.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22630.      ║ WORDGET.C    ║   file date: 03/13/93    page   1 of   2 ║ WORDGET.C    ║
  22631.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22632.  
  22633.      /*                       ┌───────────────────────┐              strwordget
  22634.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  22635.                               └───────────────────────┘
  22636.                                copyright(c) 1992, 1993
  22637.      
  22638.      function:       strwordget (STRing WORD GET)
  22639.      
  22640.      KWIC:           %get the %word starting at a given pointer
  22641.      
  22642.      syntax:         #include "hhstring.h"
  22643.                      char *strwordget(char *word, char *ptr)
  22644.      
  22645.      description:    the word pointed to by ptr is transferred to word, one
  22646.                      character at a time, until a word terminator is found,
  22647.                      at which point word is terminated.
  22648.      
  22649.      returns:        a pointer to word
  22650.      
  22651.      comments:       This is primarily a support function for use by the other
  22652.                      functions listed below in "see also".
  22653.      
  22654.                      Unlike strwordthis, strwordget does NOT scan backwards
  22655.                      looking for the beginning of a word. It takes the pointer
  22656.                      that it is given as the beginning of the desired word.
  22657.      
  22658.                      if the input pointer points to a word terminator, then
  22659.                      word will be set to NULL
  22660.      
  22661.                      The string pointed to by the return value of this function
  22662.                      is in the calling function's space. The return value is
  22663.                      provided as a convenience, not a necessity.
  22664.      
  22665.      keywords:       string, word
  22666.      
  22667.      key sentence:   copies the word starting at a given pointer into a
  22668.                      specified string
  22669.      
  22670.      see also:       strword< first | get | last | next | prev | this >
  22671.      
  22672.  
  22673.  
  22674.  
  22675.  
  22676.  
  22677.  
  22678.  
  22679.  
  22680.  
  22681.  
  22682.  
  22683.  
  22684.  
  22685.  
  22686.  
  22687.                          The Hobbit House String Library               page 365
  22688.  
  22689.  
  22690.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22691.      ║ WORDGET.C    ║   file date: 03/13/93    page   2 of   2 ║ WORDGET.C    ║
  22692.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22693.  
  22694.      
  22695.      
  22696.      usage example:  compiled/executed/verified on 1/15/93
  22697.      
  22698.                      char *string = "this that and the other";
  22699.                      char word[80];
  22700.                      strwordget(word, string);
  22701.                      printf("\n%s", word);
  22702.                      printf("\n%s", strwordget(word, string + 6));
  22703.                      printf("\n%s", strwordget(word, string + 4));
  22704.      
  22705.                      this
  22706.                      hat
  22707.                      (null)
  22708.      
  22709.                               ┌───────────────────────┐
  22710.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  22711.                               └───────────────────────┘                      */
  22712.  
  22713.  
  22714.  
  22715.  
  22716.  
  22717.  
  22718.  
  22719.  
  22720.  
  22721.  
  22722.  
  22723.  
  22724.  
  22725.  
  22726.  
  22727.  
  22728.  
  22729.  
  22730.  
  22731.  
  22732.  
  22733.  
  22734.  
  22735.  
  22736.  
  22737.  
  22738.  
  22739.  
  22740.  
  22741.  
  22742.  
  22743.  
  22744.  
  22745.  
  22746.  
  22747.  
  22748.      page 366            The Hobbit House String Library
  22749.  
  22750.  
  22751.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22752.      ║ WORDLAST.C   ║   file date: 03/13/93    page   1 of   1 ║ WORDLAST.C   ║
  22753.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22754.  
  22755.      /*                       ┌───────────────────────┐             strwordlast
  22756.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  22757.                               └───────────────────────┘
  22758.                                copyright(c) 1992, 1993
  22759.      
  22760.      function:       strwordlast (STRing, get WORD, LAST)
  22761.      
  22762.      KWIC:           %get the %last %word in a string
  22763.      
  22764.      syntax:         #include "hhstring.h"
  22765.                      char *strwordlast(char *lastword, char *instring)
  22766.      
  22767.      description:    the last word in instring is copied to lastword. Trailing
  22768.                      word terminators are ignored.
  22769.      
  22770.      returns:        a pointer to lastword or NULL if none found
  22771.      
  22772.      comments:       The string pointed to by the return value of this function
  22773.                      is in the calling function's space. The return value is
  22774.                      provided as a convenience, not a necessity.
  22775.      
  22776.                      If the string is empty or white, lastword will be empty
  22777.                      and the return will be NULL
  22778.      
  22779.      keywords:       string, word, last
  22780.      
  22781.      key sentence:   copies the last word in a string to another string
  22782.      
  22783.      see also:       strword< first | get | last | next | prev | this >
  22784.      
  22785.      usage example:  compiled/executed/verified on 2/21/93
  22786.      
  22787.                      char *Astring = "this is the sample string.\n";
  22788.                      char *Bstring = "another one";
  22789.                      char Dstring[80];
  22790.                      strwordlast(Dstring, Astring);
  22791.                      printf("\n%s", Dstring);
  22792.                      printf("\n%s", strwordlast(Dstring, Bstring));
  22793.                      printf("\n%s", strwordlast(Dstring, " \t\n "));
  22794.                      printf("\n%s", strwordlast(Dstring, ""));
  22795.      
  22796.                      string.
  22797.                      one
  22798.                      (null)
  22799.                      (null)
  22800.      
  22801.                               ┌───────────────────────┐
  22802.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  22803.                               └───────────────────────┘                      */
  22804.  
  22805.  
  22806.  
  22807.  
  22808.  
  22809.                          The Hobbit House String Library               page 367
  22810.  
  22811.  
  22812.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22813.      ║ WORDNEXT.C   ║   file date: 03/13/93    page   1 of   2 ║ WORDNEXT.C   ║
  22814.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22815.  
  22816.      /*                       ┌───────────────────────┐             strwordnext
  22817.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  22818.                               └───────────────────────┘
  22819.                                copyright(c) 1992, 1993
  22820.      
  22821.      function:       strwordnext (STRing, get WORD, NEXT)
  22822.      
  22823.      KWIC:           %get the %next %word in a string
  22824.      
  22825.      syntax:         #include "hhstring.h"
  22826.                      char *strwordnext(char *nextword, char *ptr)
  22827.      
  22828.      description:    scans from ptr for the next word terminator (to assure
  22829.                      that the current word, if any, is bypassed) and then
  22830.                      searches for the next non-word-terminator as the start of
  22831.                      the next word. At that point, it begins copying the
  22832.                      characters into nextword until a word terminator is
  22833.                      encountered, at which point, it terminates nextword
  22834.      
  22835.                      If EOS is found before a word is found, nextword will
  22836.                      be empty and the return will be NULL
  22837.      
  22838.      returns:        a pointer to nextword or NULL if none found
  22839.      
  22840.      comments:       This function handles words at the end of a line by
  22841.                      dealing with '\n' and '\0' termination characters. This
  22842.                      does mean that if one creates a string with embedded '\n'
  22843.                      characters, this function will terminate before the
  22844.                      string ends. The function is designed to work with lines,
  22845.                      as a word processor (including a human) thinks of lines,
  22846.                      not strings in the more general sense.
  22847.      
  22848.                      The string pointed to by the return value of this function
  22849.                      is in the calling function's space. The return value is
  22850.                      provided as a convenience, not a necessity.
  22851.      
  22852.      keywords:       string, word, next
  22853.      
  22854.      key sentence:   copies the next word in a string to another string
  22855.      
  22856.      see also:       strword< first | get | last | next | prev | this >
  22857.      
  22858.  
  22859.  
  22860.  
  22861.  
  22862.  
  22863.  
  22864.  
  22865.  
  22866.  
  22867.  
  22868.  
  22869.  
  22870.      page 368            The Hobbit House String Library
  22871.  
  22872.  
  22873.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22874.      ║ WORDNEXT.C   ║   file date: 03/13/93    page   2 of   2 ║ WORDNEXT.C   ║
  22875.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22876.  
  22877.      
  22878.      
  22879.      usage example:  compiled/executed/verified on 2/21/93
  22880.      
  22881.                      char *line = "This is\tthe line";
  22882.                      char Next[20];
  22883.                      strwordnext(Next, line);
  22884.                      printf("\n%s", Next);
  22885.                      printf("\n%s", strwordnext(Next, line + 4));
  22886.                      printf("\n%s", strwordnext(Next, line + 13));
  22887.                      printf("\n%s", strwordnext(Next, "   \t   "));
  22888.                      printf("\n%s", strwordnext(Next, ""));
  22889.      
  22890.                      is
  22891.                      is
  22892.                      (null)
  22893.                      (null)
  22894.                      (null)
  22895.      
  22896.                               ┌───────────────────────┐
  22897.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  22898.                               └───────────────────────┘                      */
  22899.  
  22900.  
  22901.  
  22902.  
  22903.  
  22904.  
  22905.  
  22906.  
  22907.  
  22908.  
  22909.  
  22910.  
  22911.  
  22912.  
  22913.  
  22914.  
  22915.  
  22916.  
  22917.  
  22918.  
  22919.  
  22920.  
  22921.  
  22922.  
  22923.  
  22924.  
  22925.  
  22926.  
  22927.  
  22928.  
  22929.  
  22930.  
  22931.                          The Hobbit House String Library               page 369
  22932.  
  22933.  
  22934.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22935.      ║ WORDPREV.C   ║   file date: 03/13/93    page   1 of   2 ║ WORDPREV.C   ║
  22936.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22937.  
  22938.      /*                       ┌───────────────────────┐             strwordprev
  22939.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  22940.                               └───────────────────────┘
  22941.                                copyright(c) 1992, 1993
  22942.      
  22943.      function:       strwordprev (STRing, get WORD, PREVious)
  22944.      
  22945.      KWIC:           %get the %previous %word from a given pointer
  22946.      
  22947.      syntax:         #include "hhstring.h"
  22948.                      char *strwordprev(char *prevword, char *ptr)
  22949.      
  22950.      description:    scans backwards from ptr for whitespace, then scans
  22951.                      backward for non-whitespace, then scans backward for
  22952.                      whitespace again and returns the word following that
  22953.                      whitespace. Think of it this way; given a pointer to any
  22954.                      point in a sentence, this function returns the word
  22955.                      preceding the one pointed to. If the pointer points at
  22956.                      whitespace, this function returns the word which precedes
  22957.                      the whitespace.
  22958.      
  22959.      returns:        a pointer to prevword
  22960.      
  22961.      comments:       If the input pointer points to the first word in a string,
  22962.                      prevword will NOT be that word but will be that word
  22963.                      preceded by all of the characters which precede it in
  22964.                      memory up to and including the previous word. Be careful!
  22965.      
  22966.                      The string pointed to by the return value of this function
  22967.                      is in the calling function's space. The return value is
  22968.                      provided as a convenience, not a necessity.
  22969.      
  22970.      keywords:       string, word, previous
  22971.      
  22972.      key sentence:   copies the word previous to a given pointer into a
  22973.                      specified string
  22974.      
  22975.      see also:       strword< first | get | last | next | prev | this >
  22976.      
  22977.  
  22978.  
  22979.  
  22980.  
  22981.  
  22982.  
  22983.  
  22984.  
  22985.  
  22986.  
  22987.  
  22988.  
  22989.  
  22990.  
  22991.  
  22992.      page 370            The Hobbit House String Library
  22993.  
  22994.  
  22995.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  22996.      ║ WORDPREV.C   ║   file date: 03/13/93    page   2 of   2 ║ WORDPREV.C   ║
  22997.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  22998.  
  22999.      
  23000.      
  23001.      usage example:  compiled/executed/verified on 12/14/92
  23002.      
  23003.                      char *stringptr = "time date size other";
  23004.                      char prevword[80];
  23005.                      strwordprev(prevword, stringptr+11);
  23006.                      printf("\n%s", prevword);
  23007.                      printf("\n%s", strwordprev(prevword, stringptr+20));
  23008.      
  23009.                      date
  23010.                      other
  23011.      
  23012.                               ┌───────────────────────┐
  23013.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  23014.                               └───────────────────────┘                      */
  23015.  
  23016.  
  23017.  
  23018.  
  23019.  
  23020.  
  23021.  
  23022.  
  23023.  
  23024.  
  23025.  
  23026.  
  23027.  
  23028.  
  23029.  
  23030.  
  23031.  
  23032.  
  23033.  
  23034.  
  23035.  
  23036.  
  23037.  
  23038.  
  23039.  
  23040.  
  23041.  
  23042.  
  23043.  
  23044.  
  23045.  
  23046.  
  23047.  
  23048.  
  23049.  
  23050.  
  23051.  
  23052.  
  23053.                          The Hobbit House String Library               page 371
  23054.  
  23055.  
  23056.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  23057.      ║ WORDTHIS.C   ║   file date: 03/13/93    page   1 of   2 ║ WORDTHIS.C   ║
  23058.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  23059.  
  23060.      /*                       ┌───────────────────────┐             strwordthis
  23061.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  23062.                               └───────────────────────┘
  23063.                                copyright(c) 1992, 1993
  23064.      
  23065.      function:       strwordthis (STRing, get WORD, THIS)
  23066.      
  23067.      KWIC:           %get %this %word (regardless of what character in the word
  23068.                      is pointed to)
  23069.      
  23070.      syntax:         #include "hhstring.h"
  23071.                      char *strwordthis(char *thisword, char *inptr)
  23072.      
  23073.      description:    scans backward from inptr until whitespace is encountered
  23074.                      and then moves the word following the whitespace into
  23075.                      thisword. If the input pointer points at whitespace or a
  23076.                      word terminator, then thisword will be empty and the
  23077.                      return will be NULL
  23078.      
  23079.      returns:        a pointer to thisword or NULL if inptr points to a word
  23080.                      terminator
  23081.      
  23082.      comments:       If the input pointer points to the first word in a string,
  23083.                      thisword will NOT be that word but will be that word
  23084.                      preceded by all of the characters which precede it in
  23085.                      memory up to and including the previous word. Be careful!
  23086.      
  23087.                      The string pointed to by the return value of this function
  23088.                      is in the calling function's space. The return value is
  23089.                      provided as a convenience, not a necessity.
  23090.      
  23091.      keywords:       string, word, this
  23092.      
  23093.      key sentence:   copies the word pointed to, regardless of what character
  23094.                      in the word is pointed to, to another string
  23095.      
  23096.      see also:       strword< first | get | last | next | prev | this >
  23097.      
  23098.  
  23099.  
  23100.  
  23101.  
  23102.  
  23103.  
  23104.  
  23105.  
  23106.  
  23107.  
  23108.  
  23109.  
  23110.  
  23111.  
  23112.  
  23113.  
  23114.      page 372            The Hobbit House String Library
  23115.  
  23116.  
  23117.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  23118.      ║ WORDTHIS.C   ║   file date: 03/13/93    page   2 of   2 ║ WORDTHIS.C   ║
  23119.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  23120.  
  23121.      
  23122.      
  23123.      usage example:  compiled/executed/verified on 2/21/93
  23124.      
  23125.                      char *string = "time date size other";
  23126.                      char thisword[80];
  23127.                      strwordthis(thisword, string+13);
  23128.                      printf("\n%s", thisword);
  23129.                      printf("\n%s", strwordthis(thisword, string+5));
  23130.                      printf("\n%s", strwordthis(thisword, string+4));
  23131.      
  23132.                      size
  23133.                      date
  23134.                      (null)
  23135.      
  23136.                               ┌───────────────────────┐
  23137.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  23138.                               └───────────────────────┘                      */
  23139.  
  23140.  
  23141.  
  23142.  
  23143.  
  23144.  
  23145.  
  23146.  
  23147.  
  23148.  
  23149.  
  23150.  
  23151.  
  23152.  
  23153.  
  23154.  
  23155.  
  23156.  
  23157.  
  23158.  
  23159.  
  23160.  
  23161.  
  23162.  
  23163.  
  23164.  
  23165.  
  23166.  
  23167.  
  23168.  
  23169.  
  23170.  
  23171.  
  23172.  
  23173.  
  23174.  
  23175.                          The Hobbit House String Library               page 373
  23176.  
  23177.  
  23178.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  23179.      ║ XCAT.C       ║   file date: 03/13/93    page   1 of   1 ║ XCAT.C       ║
  23180.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  23181.  
  23182.      /*                       ┌───────────────────────┐                 strxcat
  23183.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  23184.                               └───────────────────────┘
  23185.                                copyright(c) 1992, 1993
  23186.      
  23187.      function:       strxcat (STRing eXtended conCATenate function)
  23188.      
  23189.      KWIC:           %concatenate %multiple strings
  23190.      
  23191.      syntax:         #include <stddef.h>
  23192.                      #include <stdarg.h>
  23193.                      #include "hhstring.h"
  23194.                      char *strxcat(char *instring, ... )
  23195.      
  23196.                      note: ... is a variable list of string pointers which,
  23197.                                for this function, must be terminated by a
  23198.                                pointer to a NULL string
  23199.      
  23200.      description:    concatenates a variable number of strings onto the
  23201.                      input string
  23202.      
  23203.      returns:        a pointer to the input string
  23204.      
  23205.      comments:       The input string must have enough memory allocated to
  23206.                      handle all of the concatenation, else there be dragons.
  23207.      
  23208.      keywords:       string, concatenate
  23209.      
  23210.      key sentence:   concatenates multiple strings
  23211.      
  23212.      see also:       strxcat{n}
  23213.      
  23214.      usage example:  compiled/executed/verified on 12/13/92
  23215.      
  23216.                      char str1[80] = "....";
  23217.                      strxcat(str1, " this,", " that,",
  23218.                              " and the other", NULL);
  23219.                      printf("\n%s", str1);
  23220.      
  23221.                      .... this, that, and the other
  23222.      
  23223.                               ┌───────────────────────┐
  23224.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  23225.                               └───────────────────────┘                      */
  23226.  
  23227.  
  23228.  
  23229.  
  23230.  
  23231.  
  23232.  
  23233.  
  23234.  
  23235.  
  23236.      page 374            The Hobbit House String Library
  23237.  
  23238.  
  23239.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  23240.      ║ XCATN.C      ║   file date: 03/13/93    page   1 of   2 ║ XCATN.C      ║
  23241.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  23242.  
  23243.      /*                       ┌───────────────────────┐                strxcatn
  23244.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  23245.                               └───────────────────────┘
  23246.                                copyright(c) 1992, 1993
  23247.      
  23248.      function:       strxcatn (STRing eXtended conCATenate, N-char limit)
  23249.      
  23250.      KWIC:           %concatenate %multiple strings but limit the %size of the
  23251.                      result to n characters
  23252.      
  23253.      syntax:         #include <stddef.h>
  23254.                      #include <stdarg.h>
  23255.                      #include "hhstring.h"
  23256.                      char *strxcatn(char *instring, int len, ... )
  23257.      
  23258.                      note: ... is a variable list of string pointers which,
  23259.                      for this function, must be terminated with a pointer to
  23260.                      a NULL string. The constant NULL is recommended; see the
  23261.                      code example below.
  23262.      
  23263.      description:    concatenates a variable number of strings onto the
  23264.                      input string, up to n characters. If the n chars are
  23265.                      reached, then a terminating '\0' is placed on the string
  23266.                      at the nth position.
  23267.      
  23268.      returns:        a pointer to the input string
  23269.      
  23270.      comments:       The input string must have enough memory allocated to
  23271.                      handle all of the concatenation, else there be dragons.
  23272.      
  23273.      keywords:       string, concatenate, size
  23274.      
  23275.      key sentence:   concatenates multiple strings but limits the result to a
  23276.                      fixed size
  23277.      
  23278.      see also:       strxcat{n}
  23279.      
  23280.  
  23281.  
  23282.  
  23283.  
  23284.  
  23285.  
  23286.  
  23287.  
  23288.  
  23289.  
  23290.  
  23291.  
  23292.  
  23293.  
  23294.  
  23295.  
  23296.  
  23297.                          The Hobbit House String Library               page 375
  23298.  
  23299.  
  23300.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  23301.      ║ XCATN.C      ║   file date: 03/13/93    page   2 of   2 ║ XCATN.C      ║
  23302.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  23303.  
  23304.      
  23305.      
  23306.      usage example:  compiled/executed/verified on 2/25/93
  23307.      
  23308.                      char str1[80] = "";
  23309.                      char stra[10] = "this, ";
  23310.                      char strb[10] = "that, ";
  23311.                      char strc[20] = "and the other";
  23312.                      strxcatn(str1, 20, stra, strb, strc, NULL);
  23313.                      printf("\n%s<--", str1);
  23314.      
  23315.                      this, that, and the <--         (note 20-char size limit)
  23316.      
  23317.                               ┌───────────────────────┐
  23318.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  23319.                               └───────────────────────┘                      */
  23320.  
  23321.  
  23322.  
  23323.  
  23324.  
  23325.  
  23326.  
  23327.  
  23328.  
  23329.  
  23330.  
  23331.  
  23332.  
  23333.  
  23334.  
  23335.  
  23336.  
  23337.  
  23338.  
  23339.  
  23340.  
  23341.  
  23342.  
  23343.  
  23344.  
  23345.  
  23346.  
  23347.  
  23348.  
  23349.  
  23350.  
  23351.  
  23352.  
  23353.  
  23354.  
  23355.  
  23356.  
  23357.  
  23358.      page 376            The Hobbit House String Library
  23359.  
  23360.  
  23361.      ╔══════════════╦══════════════════════════════════════════╦══════════════╗
  23362.      ║ ZERO.C       ║   file date: 03/13/93    page   1 of   1 ║ ZERO.C       ║
  23363.      ╚══════════════╩══════════════════════════════════════════╩══════════════╝
  23364.  
  23365.      /*                       ┌───────────────────────┐                 strzero
  23366.      ┌────────────────────────┤ Hobbit House Software ├───────────────────────┐
  23367.                               └───────────────────────┘
  23368.                                copyright(c) 1992, 1993
  23369.      
  23370.      function:       strzero (STRing, set to all ZEROs)
  23371.      
  23372.      KWIC:           set a string to all ASCII %zeros
  23373.      
  23374.      syntax:         #include "hhstring.h"
  23375.                      char *strzero(char *instring)
  23376.      
  23377.      description:    takes a string which has a terminating '\0' and fills it
  23378.                      with ASCII zero characters (i.e. '0')
  23379.      
  23380.      returns:        a pointer to the string
  23381.      
  23382.      comments:       this is a macro which is defined in hhstring.h as:
  23383.      
  23384.                      #define strzero(s)      strset(s, '0')
  23385.      
  23386.      keywords:       string, character, set
  23387.      
  23388.      key sentence:   sets a string to all ASCII zeros
  23389.      
  23390.      see also:       str< blank | eos | set | zero >
  23391.      
  23392.      usage example:  compiled/executed/verified on 1/19/93
  23393.      
  23394.                      char *instring = "this string";
  23395.                      strzero(instring);
  23396.                      printf("%s%d", instring, strlen(instring));
  23397.      
  23398.                      0000000000011
  23399.      
  23400.                               ┌───────────────────────┐
  23401.      └────────────────────────┤ Hobbit House Software ├───────────────────────┘
  23402.                               └───────────────────────┘                      */
  23403.  
  23404.  
  23405.  
  23406.  
  23407.  
  23408.  
  23409.  
  23410.  
  23411.  
  23412.  
  23413.  
  23414.  
  23415.  
  23416.  
  23417.  
  23418.  
  23419.                          The Hobbit House String Library               page 377
  23420.  
  23421.